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 :(
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With