Re: p2: Content-Length in HEAD responses

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.

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.

> (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.

Willy

Received on Saturday, 20 April 2013 09:07:11 UTC