Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is replying to client before receiving complete request allowed for HTTP 1.0 server?

I couldn't find RFC that may answer this question. Perhaps you guys can point me to right direction.

I'm implementing strippeddown http server whose only function is to accept big multi-part encoded uploads.

In certain cases, such as file is too big or client is not authorized to upload, I want server to reply with error and close connection immediately.

It looks like Chrome browser doesn't like it because it thinks server returned http code zero.

Could not get any response

This seems to be like an error connecting to http://my_ubuntu:8080/api/upload. The response status was 0.
Check out the W3C XMLHttpRequest Level 2 spec for more details about when this happens.

Therefore question:

Is replying to client before receiving complete request allowed for HTTP server ?

update: Just tested it with iOS 6 client. Same thing, it thinks server abruptly closed connection :(

like image 284
expert Avatar asked Nov 13 '12 09:11

expert


People also ask

What are the essential differences between HTTP 1.0 and HTTP 1.1 connections?

HTTP 1.1 comes with persistent connections which define that we can have more than one request or response on the same HTTP connection. while in HTTP 1.0 you have to open a new connection for each request and response. In HTTP 1.0 it has a pragma while in HTTP 1.1 it has Cache-Control this is similar to pragma.

Is HTTP 1.0 still used?

A small number of mobile applications still use HTTP 1.0. This early version of the HTTP protocol doesn't support improvements, like persistent TCP connections, that make HTTP 1.1 much more efficient to use.


1 Answers

This is a great question and apparently it is very ambiguous. You will probably enjoy reading this article on the "Million Dollar Bug" - http://jacquesmattheij.com/the-several-million-dollar-bug

like image 86
bitops Avatar answered Oct 04 '22 06:10

bitops