On Mon, Sep 20, 2010 at 12:31 PM, Matt Goodall <matt.good...@gmail.com>wrote:

> Servers should definitely not transform a HEAD to a GET.
>
> Transforming HEAD to GET and then discarding the body is often not a bad
> default but an application may well want to handle the HEAD explicitly. For
> instance, an application's HEAD handler may only need to check an ETag in a
> database before returning a "304 Not Modified" response (with the correct
> Content-Length and no body, of course).
>
> Similarly, it's almost certainly a bad idea for a WSGI server or middleware
> to change the Content-Length header in the application's HTTP response
> because there may be no body to look at.
>

If a piece of output-transforming middleware is being picky, it could change
HEAD to GET on the incoming request, then throw away the response body on
its own.  This is not a great strategy, but at least it seems like it will
create a generally correct result.

-- 
Ian Bicking  |  http://blog.ianbicking.org
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to