Re: Content-length returned from HEAD requests?

2002-03-13 Thread Roy T. Fielding

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



Content-length returned from HEAD requests?

2002-03-12 Thread Aaron Bannert

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



Re: Content-length returned from HEAD requests?

2002-03-12 Thread Aaron Bannert

On Tue, Mar 12, 2002 at 10:48:08AM -0800, 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.

Same thing for Content-type for that matter...

-a



Re: Content-length returned from HEAD requests?

2002-03-12 Thread Brian Pane

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.

--Brian





Re: Content-length returned from HEAD requests?

2002-03-12 Thread Marc Slemko

On Tue, 12 Mar 2002, 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.

of course it is, that's the whole idea of a HEAD... to get the headers
that you would get if you did a GET.




RE: Content-length returned from HEAD requests?

2002-03-12 Thread Ryan Bloom

It is a requirement from the spec.  HEAD requests should behave exactly
as GET requests do, except there is no body.

Ryan

--
Ryan Bloom  [EMAIL PROTECTED]
645 Howard St.  [EMAIL PROTECTED]
San Francisco, CA 

 -Original Message-
 From: Aaron Bannert [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, March 12, 2002 10:48 AM
 To: [EMAIL PROTECTED]
 Subject: Content-length returned from HEAD requests?
 
 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




Re: Content-length returned from HEAD requests?

2002-03-12 Thread Dale Ghent

On Tue, 12 Mar 2002, 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.

IIRC, HEAD is analogous to GET, just minus the content itself... so you
should see the full header information as if it were a GET request.

Content-length is returned by 1.3.23 after a HEAD request, as well:

[daleg@lithium]~telnet . 80
Trying 0.0.0.0...
Connected to ..
Escape character is '^]'.
HEAD /~daleg/ HTTP/1.1
Host: elemental.org

HTTP/1.1 200 OK
Date: Tue, 12 Mar 2002 19:03:17 GMT
Server: Apache/1.3.23 (Unix) PHP/4.1.1
Last-Modified: Sun, 31 Oct 1999 22:01:07 GMT
ETag: 97915-112e-381cbc23
Accept-Ranges: bytes
Content-Length: 4398
Content-Type: text/html

/dale