Transfer-Encoding in a HEAD response

I have recently noticed that many public websites, in responding to a
HEAD request, will:

- omit Transfer-Encoding from the response headers if the GET response
will be chunk-encoded;
-- or (as expected) set the Content-Length if the GET response isn't
going to be chunk-encoded;
- or set Content-Length = 0;
- or set a manual Content-Length as if there would be no
chunk-encoding for the GET response.

While rfc-2616 doesn't require all the headers appear in the HEAD
response, the confusion here mostly lies in whether Transfer-Encoding
is applicable for a HEAD response (as it is the case for
Content-Length).

To clarify, 7.4 (9.4/rfc2616) may state: "The metainformation
contained in the HTTP headers in response to a HEAD request SHOULD be
identical to the information sent in response to a GET request; and
any headers that describe message body should be applied to the
response of the GET request".

- Wenbo

Received on Sunday, 11 April 2010 22:06:12 UTC