httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@apache.org>
Subject Re: Content-length returned from HEAD requests?
Date Wed, 13 Mar 2002 21:15:31 GMT
On Tue, Mar 12, 2002 at 10:57:50AM -0800, Brian Pane wrote:
> Aaron Bannert wrote:
> 
> >Is it valid for Content-length to be returned from these types
> >of requests? daedalus is showing it, and I'm seeing it in current CVS.
> >
> >-aaron
> >
> 
> I don't think so, unless it's "Content-Length: 0", due to this
> part of section 10.2.7 in RFC 2616:
> "If a Content-Length header field is present in the response,
> its value MUST match the actual number of OCTETs transmitted in
> the message-body."

That section is on the 206 response, not a 200 response.

Section 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. All 1xx
   (informational), 204 (no content), and 304 (not modified) responses
   MUST NOT include a message-body. All other responses do include a
   message-body, although it MAY be of zero length.

4.4 Message Length

   The transfer-length of a message is the length of the message-body as
   it appears in the message; that is, after any transfer-codings have
   been applied. When a message-body is included with a message, the
   transfer-length of that body is determined by one of the following
   (in order of precedence):

   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.

....Roy

Mime
View raw message