Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1180

Add default HEAD servlet

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Servlets Get 2.0.6
    • Servlets Get 2.0.8
    • Servlets
    • 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

      Attachments

        1. SLING-1180.patch
          5 kB
          Felix Meschberger

        Activity

          People

            fmeschbe Felix Meschberger
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: