Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

HTTP HEAD request results in a 500 response code

#12

Running curl -I (a HEAD request) on a limonade page will ALWAYS result in a 500.

This behavior can be quite misleading, and doesn't really make much sense.

See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.

This occurs because HEAD is not in request_methods(), and because it is not matched to a dispatch_*() method.

One approach to fix this is to add head to request_methods(), and map HEAD requests to the corresponding dispatch_get(), BUT prevent output of a body. A shortcut would be just to respond with 404/200 depending on the existence of a route for GET as defined by a dispatch_*()

Reported by Leonard Chin · July 7th, 2009 @ 06:38 PM

State: resolved
Assigned to: Fabrice Luraine Fabrice Luraine

Activity

  1. Fabrice Luraine
    Fabrice Luraine
    • Milestone set to Release 0.4 - Fresh Mint And Ginger
    • Assigned user set to Fabrice Luraine

    In the 0.4 branch, it will return a 501 Not Implemented.
    I will try to fix that in this release, probably with your first solution.

    Thks

    July 8th, 2009 @ 10:30 AM

  2. Fabrice Luraine

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.