Hello again,
We're attempting to implement a correct response for HEAD requests by minimizing the amount of work the pipelines do (as they are performing some pretty heavyweight transformations). We can happily generate the HTTP response using the HTTP serializer - apart from the problem of Content-Length. The value generated for this is wrong (for what we want to do) as we aren't going through the actions that we would for a GET request - we're simply creating a lightweight response. According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13 for a HEAD request the Content-Length should be the same as for a GET request. So if we output the value we generate from our lightweight response we are contravening this. However, it also states that Content-Lengh usage is a SHOULD, and therefore we think that it is okay to omit this value. So the question is, can we restrict the outputting of Content-Length from the response header? I can't find a way to do so. Thanks Paul |
Administrator
|
Paul,
Currently, there is no way to prevent the serializer to set the length if it knows it (which should occur only if the content was cached). Some possible ways forward: 1. Make this configurable in the serializer 2. Use a Servlet filter to filter out the header or prevent setContentLength() from being honored if the request is a HEAD -Erik On May 13, 2009, at 9:20 AM, Paul Appleby wrote: > > Hello again, > > We're attempting to implement a correct response for HEAD requests by > minimizing the amount of work the pipelines do (as they are > performing some > pretty heavyweight transformations). > > We can happily generate the HTTP response using the HTTP serializer > - apart > from the problem of Content-Length. The value generated for this is > wrong > (for what we want to do) as we aren't going through the actions that > we > would for a GET request - we're simply creating a lightweight > response. > > According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13 > for a HEAD request the Content-Length should be the same as for a GET > request. So if we output the value we generate from our lightweight > response > we are contravening this. > > However, it also states that Content-Lengh usage is a SHOULD, and > therefore > we think that it is okay to omit this value. > > So the question is, can we restrict the outputting of Content-Length > from > the response header? I can't find a way to do so. > > Thanks > > Paul > -- > View this message in context: http://www.nabble.com/HEAD-and-GET-requests-tp23525166p23525166.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |