httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@gbiv.com>
Subject Content-Length or Transfer-Encoding on HEAD responses
Date Mon, 05 Dec 2005 21:17:04 GMT
On Dec 5, 2005, at 10:19 AM, William A. Rowe, Jr. wrote:

> William A. Rowe, Jr. wrote:
>> But the obvious tangle becomes - do we return T-E chunked - and is  
>> that
>> a valid header as a HEAD response with no body?
>
> From 2616 4.3,
>
>    For response messages, whether or not a message-body is included  
> with
>    a message is dependent on both the request method and the response
>    status code (section 6.1.1). All responses to the HEAD request  
> method
>    MUST NOT include a message-body, even though the presence of  
> entity-
>    header fields might lead one to believe they do.
>
> I read this that the T-E entity-header field should be forwarded.

I disagree. T-E is a general-header field and must not
be provided if there is no message-body (see section 4.4).

    1.Any response message which "MUST NOT" include a message-body (such
      as the 1xx, 204, and 304 responses and any response to a HEAD
      request) is always terminated by the first empty line after the
      header fields, regardless of the entity-header fields present in
      the message.

> Under 4.4
>
>    2.If a Transfer-Encoding header field (section 14.41) is present  
> and
>      has any value other than "identity", then the transfer-length is
>      defined by use of the "chunked" transfer-coding (section 3.6),
>      unless the message is terminated by closing the connection.

Which is obviously conditioned on number 1 above it.

> But the only way we know we will send the same T-E and C-L values  
> is to
> determine the C-L as a result of piping the results through the output
> filters to the network stack.  Your patch suggests we should ignore  
> that
> potential issue.

That is completely irrelevant to forwarding a HEAD response.

....Roy


Mime
View raw message