Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Servlets Get 2.0.6
-
None
Description
RFC 2616 states: "The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response."
Currently Sling has no out-of-the-box support for handling HEAD requests and thus most HEAD requests will (in a default Sling installation) be handled by WebDAV servlet which handles all requests not handled by any other servlet/script.
I suggest we add a DefaultHeadServlet which handles HEAD requests as follows:
- wrap the response dropping any output (null writer/outputstream)
- wrap request overwriting the getMethod() method simulating a GET request
- forward the request to the request resource