Re: What should happen when you HEAD a CGI script?

Rob McCool (robm@ncsa.uiuc.edu)
Mon, 20 Dec 1993 01:13:40 -0600


/*
* What should happen when you HEAD a CGI script? by "Roy T. Fielding" (fielding@simplon.ICS.UCI.EDU)
* written on Dec 18, 2:58am.
*
* While poking around in the NCSA httpd_1.0 source code, I noticed that
* the CGI script interface does not treat the HEAD method differently
* than the GET method. Unlike the older htbin interface, performing a
*
* HEAD /cgi-bin/script HTTP/1.0
*
* will return exactly the same result (including body contents) as the
*
* GET /cgi-bin/script HTTP/1.0
*
* request. There is no mention of HEAD responses in the initial CGI spec.
*
* Is this just a simple oversight? Or is it a feature?

Originally it was intended that scripts could check if REQUEST_METHOD is
HEAD, then they could perform the action themselves. However, the server
should probably limit their output in order to keep scripts small. I'll fix
it.

* My preference would be for HEAD to check the existance, authorization,
* and executability of the script and just return the response headers.
* Am I missing something (besides sleep)?
*/

It wouldn't be able to return content-type.

--Rob