BUG: Incorrect handling of HEAD requests for error handlers
Posted by Chris Webb (Guest)
on 26.07.2007 09:48
Something has changed in the handling of HTTP HEAD requests between
lighttpd 1.4.13 and 1.4.16. I have a typical rails-style configuration
server.error-handler-404 = "/dispatch.fcgi"
and GET requests for pages handled by /dispatch.fcgi work correctly with
a 200 OK response in both versions. However, on 1.4.16, a HEAD request
gets returned with a 404 Not Found response whereas the same
configuration on 1.4.13 correctly returns a 200 OK matching the
corresponding GET (as it should):
$ telnet new-version 80 Trying 127.0.0.2... Connected to new-version. Escape character is '^]'. HEAD / HTTP/1.0 Host: www.testsite.com HTTP/1.0 404 Not Found Connection: close Content-Type: text/html; charset=utf-8 Cache-Control: no-cache Content-Length: 3813 Date: Thu, 26 Jul 2007 09:16:22 GMT Server: lighttpd/1.4.16 Connection closed by foreign host.
$ telnet old-version 80 Trying 127.0.0.3... Connected to old-version. Escape character is '^]'. HEAD / HTTP/1.0 Host: www.testsite.com HTTP/1.0 200 OK Connection: close Content-Type: text/html; charset=utf-8 Cache-Control: no-cache Content-Length: 3813 Date: Thu, 26 Jul 2007 09:21:06 GMT Server: lighttpd/1.4.13 Connection closed by foreign host.
This is potentially very serious because of the way it will interact
with web caches.
Also available in: Atom