[Zope] HEAD Requests

Martijn Pieters mj@antraciet.nl
Wed, 05 May 1999 15:53:49 +0200


At 15:09 05/05/99 , Brian Lloyd wrote:
>I'd like to debate this one a little bit. You are correct in that
>a HEAD on a folder does not behave in quite the same way as a GET
>- that should be fixed. I have tried to use the HTTP spec
>and comparisons with the default behaviors of common servers
>(mainly Apache) in determining what HEAD should do.
>
>Note that on apache, if you do a HEAD on a directory that contains
>no "default document", you also get a 200:
>
>HTTP/1.1 200 OK
>Date: Wed, 05 May 1999 13:06:48 GMT
>Server: Apache/1.3.4 (Unix)
>Connection: close
>Content-Type: text/html
>
>...so I dont necessarily agree that this is incorrect behavior.

Hmm... the HTTP 1.1 specs say that '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'.

Did you check what the Apache server you tested on returns on a GET 
request? It could be it is configured to return a directory listing, at 
which point the response to a HEAD request SHOULD give a 200 OK.

On MS IIS, a HEAD or GET request on a directory always returns the same 
headers, wether there is a default document or not, and wether directory 
browsing is allowed or not. In the last case (no default doc, and browsing 
not allowed), the server returns a 403, forbidden.

On Netscape Enterprise 3.0, HEAD and GET headers are also consistently the 
same. When Directory Indexing is set to 'None', and there is no default 
document, the server returns (both for GET and HEAD), a 500 Server Error 
response.

Zope returns a 404 Not Found on a GET on an empty Folder, but a 200 on a 
HEAD... not consistent.


--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-6254545 Fax: +31-35-6254555
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------