[2.0] Play does not respond to HTTP HEAD requests
Reported by Stefan Saasen | April 24th, 2012 @ 01:52 PM
Play 2.0 does not respond to HTTP HEAD requests.
For a new play application the actual behavior is:
 λ > curl -I http://localhost:9000/ HTTP/1.1 404 Not Found Content-Type: text/html; charset=utf-8 Content-Length: 4408
The expected behavior would be (if there is a corresponding GET route defined):
 λ > curl -I http://localhost:9000/ HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 Content-Length: 6590
RFC 2616 indicates that HEAD should be identical to GET and could be automatically handled for all routes defined for GET requests.
The HEAD method is identical to GET except that the server MUST
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.
Comments and changes to this ticket
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »