411 Length Required error

Dave Cheney dave at cheney.net
Tue Dec 2 03:35:58 MSK 2008

> It seems that Apache allowed always such requests (POSTs without
> Content-Length). I'm not sure should I add this ?
Looking into the RFC's it looks like Apache might be doing the right thing.


   A valid Content-Length is required on all HTTP/1.0 POST requests. An
   HTTP/1.0 server should respond with a 400 (bad request) message if it
   cannot determine the length of the request message's content.


   The presence of a message-body in a request is signaled by the inclusion

   of a Content-Length or Transfer-Encoding header field in the request's


POST /someurl HTTP/1.1
Host: whatever

Is a valid post request, but only in the case that the request does not
contain a body. If the post does contain a body, then it must be identified
as such with a Content-Lenth: header.



More information about the nginx mailing list