You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Justin Erenkrantz <je...@apache.org> on 2002/06/13 07:48:49 UTC

HEAD of a CGI script returning Content-Length?

I noticed that when issuing a HEAD request on a CGI page (trying
unsuccessfully to reproduce the showstopper), the Content-Length is
not returned.

RFC 2616 Section 9.4:

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.

Obviously, there's wiggle-room here, but we could be nice and send
the Content-Length.  This does make the cost of a HEAD be equivalent
to a GET (except for network I/O), but it ensures identical headers
returned to the client.  (Apache 1.3 doesn't send C-L either...)

Thoughts?  -- justin

Re: HEAD of a CGI script returning Content-Length?

Posted by Greg Ames <gr...@apache.org>.
rbb@apache.org wrote:
> 
> On Wed, 12 Jun 2002, Justin Erenkrantz wrote:
> 
> > I noticed that when issuing a HEAD request on a CGI page (trying
> > unsuccessfully to reproduce the showstopper), the Content-Length is
> > not returned.
> >
> > RFC 2616 Section 9.4:
> >
> > 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.
> >
> > Obviously, there's wiggle-room here, but we could be nice and send
> > the Content-Length.  This does make the cost of a HEAD be equivalent
> > to a GET (except for network I/O), but it ensures identical headers
> > returned to the client.  (Apache 1.3 doesn't send C-L either...)
> >
> > Thoughts?  -- justin
> 
> This has been discussed before, and every time it is, we state
> unequivicably that we need to return the C-L.  Not because the spec says
> we need to, but because it is the correct thing to do.

or to make it more general, any time the output of a HEAD request differs from
the output of a GET request other than not having a body, that's a bug.

Greg

Re: HEAD of a CGI script returning Content-Length?

Posted by rb...@apache.org.
On Wed, 12 Jun 2002, Justin Erenkrantz wrote:

> I noticed that when issuing a HEAD request on a CGI page (trying
> unsuccessfully to reproduce the showstopper), the Content-Length is
> not returned.
> 
> RFC 2616 Section 9.4:
> 
> 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.
> 
> Obviously, there's wiggle-room here, but we could be nice and send
> the Content-Length.  This does make the cost of a HEAD be equivalent
> to a GET (except for network I/O), but it ensures identical headers
> returned to the client.  (Apache 1.3 doesn't send C-L either...)
> 
> Thoughts?  -- justin

This has been discussed before, and every time it is, we state
unequivicably that we need to return the C-L.  Not because the spec says
we need to, but because it is the correct thing to do.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
550 Jean St
Oakland CA 94610
-------------------------------------------------------------------------------