head requests and chunked transfer encoding

Daniel Crompton lists at ruby-forum.com
Thu Oct 23 15:22:38 MSD 2008

Igor Sysoev wrote:
> On Wed, Oct 01, 2008 at 11:05:19AM +0200, Spil Games wrote:
>> least one empty chunk when claimed to do chunked transfer encoding.
>> Wouldn't it be better to not use chunked transfer encoding at all for
>> HEAD requests?
> Yes, nginx should not set the "Transfer-Encoding: chunked".
> The attached patch fixes this.

What about the other way round? I send the following:

User-Agent: Wget/1.11.3
Accept: */*
Host: localhost
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Transfer-Encoding: chunked
Content-Length: 142

<-- body here -->

And receive:

HTTP/1.1 411 Length Required
Server: nginx
Date: Thu, 23 Oct 2008 11:08:57 GMT
Content-Type: text/html
Content-Length: 146
Connection: close

<head><title>411 Length Required</title></head>
<body bgcolor="white">
<center><h1>411 Length Required</h1></center>

I think that somebody took rfc2616 section 4.4 a little to literally:
<blockquote><i>3. ... If a message is received with both a 
Transfer-Encoding header field and a Content-Length header field, the 
latter MUST be ignored.</i></blockquote>

Content-Length MUST be ignored, but it doesn't mean it should bail with 
an error. Or am I missing something?
Posted via http://www.ruby-forum.com/.

More information about the nginx mailing list