Re: p2: Content-Length in HEAD responses

On 20/04/2013, at 7:06 PM, Willy Tarreau <w@1wt.eu> wrote:

> On Sat, Apr 20, 2013 at 06:41:01PM +1000, Mark Nottingham wrote:
>> p2 4.3.2 says:
>> 
>>    Aside from the payload header fields (Section 3.3), the server SHOULD
>>    send the same header fields in response to a HEAD request as it would
>>    have sent if the request had been a GET.
>> 
>> The payload header fields include Content-Length, which in my testing is
>> pretty common in HEAD responses. Was this an oversight, or intentional?
> 
> In my opinion it was intentional, as it's the only way for a client
> to know the payload size in advance without retrieving the file.

I was asking if it was intentional that, as currently specified, we say that C-L should be *omitted* from HEAD responses.

> Also I remember about at least one cache which used to truncate cached
> contents when a server returned "content-length: 0" in response to a
> HEAD request. So most likely, especially due to caches, we don't want
> the server to return a different content-length on HEAD as much as
> possible.

Yes, I see that quite a bit.

>> (We already have an exception for HEAD responses in p1's message body length
>> algorithm, section 3.3.3).
> 
> Exactly, so the SHOULD above should not cause any issue.


At best it's a sloppy SHOULD, but I think it's actively misleading, at the moment... it's saying you SHOULD send the headers back, EXCEPT for a set which includes C-L.

--
Mark Nottingham   http://www.mnot.net/

Received on Saturday, 20 April 2013 09:12:23 UTC