在收到HTTP 1.0服务器允许的完整请求之前回复客户端?

exp*_*ert 6 post boost google-chrome http xmlhttprequest

我找不到可以回答这个问题的RFC.也许你们可以指出我正确的方向.

我正在实现strippeddown http服务器,其唯一的功能是接受大型多部分编码上传.

在某些情况下,如文件太大或客户端无权上传,我希望服务器立即回复错误并关闭连接.

看起来Chrome浏览器不喜欢它,因为它认为服务器返回http代码为零.

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.
Run Code Online (Sandbox Code Playgroud)

因此问题:

在收到HTTP服务器允许的完整请求之前回复客户端吗?

更新:刚刚使用iOS 6客户端进行了测试.同样的事情,它认为服务器突然关闭连接:(

bit*_*ops 1

这是一个很好的问题,而且显然它非常含糊。您可能会喜欢阅读这篇关于“百万美元错误”的文章 - http://jacquesmattheij.com/the-several-million-dollar-bug