[PATCH] Allow PUT requests with empty bodies

Maxim Dounin mdounin at mdounin.ru
Tue Dec 28 17:06:04 MSK 2010


Hello!

On Mon, Dec 27, 2010 at 04:44:39PM -0800, Michael Schurter wrote:

> As of 0.8.54 nginx returns a 411 Length Required response upon
> receiving a PUT with no Content-Length header. There is nothing in the
> HTTP 1.1 RFC that disallows empty PUTs. "Content-Length: n" or
> "Transfer-Encoding: chunked" are only required if there is a body.
> Therefore I saw no reason for this check to exist and removed it to
> permit our RESTful HTTP API to function as currently designed.
> 
> PUTs with no body or Content-Length header seem to work as expected as
> do PUTs with a Content-Length and body message.
> 
> Any chance of getting this patch accepted into nginx 0.8?

I tend to agree, at least this is in line with not-requiring 
entity-body on POSTs (0.7.25+).

But this probably require patching dav module, it may not be 
prepared to handle PUT requests without entity-body (not sure, but 
should be checked).

Maxim Dounin



More information about the nginx-devel mailing list