On Mon, Sep 20, 2010 at 12:31 PM, Matt Goodall <span dir="ltr"><<a href="mailto:matt.goodall@gmail.com">matt.goodall@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div>Servers should definitely not transform a HEAD to a GET.</div><div><br></div><div>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).</div>
<div><br></div><div>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.</div>
</div></blockquote><div><br>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.<br>
</div></div><br>-- <br>Ian Bicking | <a href="http://blog.ianbicking.org">http://blog.ianbicking.org</a><br>