[Web-SIG] PEP 444 (aka Web3)

Ian Bicking ianb at colorstudy.com
Mon Sep 20 18:36:42 CEST 2010

On Mon, Sep 20, 2010 at 12:31 PM, Matt Goodall <matt.goodall at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20100920/ba20927b/attachment.html>

More information about the Web-SIG mailing list