<div class="gmail_quote">On 20 September 2010 16:19, Robert Brewer <span dir="ltr"><<a href="mailto:fumanchu@aminus.org" target="_blank">fumanchu@aminus.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> On Sun, 2010-09-19 at 21:52 -0400, Chris McDonough wrote:<br>
><br>
> > I'm -0 on the server trying to guess the Content-Length header. It<br>
> just<br>
> > doesn't seem like much of a burden to place on an application and<br>
> it's<br>
> > easier to specify that an application must do this than it is to<br>
> specify<br>
> > how a server should behave in the face of a missing Content-Length.<br>
> I<br>
> > also believe Graham has argued against making the server guess, I<br>
> > presume this causes him some pain somehow (probably<br>
> underspecification<br>
> > in WSGI).<br>
><br>
> Graham's issues with requiring the server to set Content-Length are<br>
> detailed here:<br>
><br>
> <a href="http://blog.dscpl.com.au/2009/10/wsgi-issues-with-http-head-" target="_blank">http://blog.dscpl.com.au/2009/10/wsgi-issues-with-http-head-</a><br>
> requests.html<br>
<br>
Chris,<br>
<br>
Thanks for that link. I had completely forgotten about that issue. I'd<br>
really appreciate it if your web3 spec made some definitive decision on<br>
whether applications and middleware are responsible for correctly<br>
differentiating HEAD from GET, or whether servers should transform HEAD<br>
to GET before invoking the first application callable. I'd personally<br>
prefer the former.</blockquote><div><br></div><div><br></div><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><br></div><div>- Matt</div></div>