#12 ✓resolved
Leonard Chin

HTTP HEAD request results in a 500 response code

Reported by Leonard Chin | July 7th, 2009 @ 06:38 PM | in Release 0.4 - Fresh Mint And Ginger

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_*()

Comments and changes to this ticket

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Limonade is a PHP micro-framework.

People watching this ticket


Referenced by