Loading ...
Sorry, an error occurred while loading the content.

60142Re: mod_perl2, HEAD request and Content-Length

Expand Messages
  • Jean-Michel Hiver
    Aug 2, 2004
    • 0 Attachment
      Geoffrey Young wrote:
      >>>??? I do not know what you mean, my GET request _has_ a content-lenght
      >>>header! For HEAD, I just do not calculate the expencive data for my body.
      >
      > that is exactly what I mean - if you include a C-L header on a GET then you
      > are supposed to have one for a HEAD request as well, expensive or not. HEAD
      > is supposed to be exactly the same as a GET in all respects except that it
      > does not have a message body.


      From RFC 2616:

      "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."


      From RFC 2119:

      "SHOULD This word, or the adjective "RECOMMENDED", mean that there
      may exist valid reasons in particular circumstances to ignore a
      particular item, but the full implications must be understood and
      carefully weighed before choosing a different course."


      I think here we've hit a "valid reason in particular circumstance" to
      strip the content-length header.

      As for the implications, content-length is used for persistent HTTP
      connections but that doesn't happen for HEAD requests - only for GETs.
      Hence there should be no ill side effects by stripping the
      Content-Length metadata for HEAD requests.


      Cheers,
      Jean-Michel.

      --
      Report problems: http://perl.apache.org/bugs/
      Mail list info: http://perl.apache.org/maillist/modperl.html
      List etiquette: http://perl.apache.org/maillist/email-etiquette.html
    • Show all 25 messages in this topic