On 07/03/2011 23:31, Konstantin Kolinko wrote:
> If some content was added before DefaultServlet was called:
> 
> 1) We will not be able to process HEAD requests correctly.
> 
> In those cases we do not serve the resource, but Content-Length header
> is returned.
> 
> Returning the content-length header consistently (and trimming the
> output by that length) is the best what we can do here.

Assuming a Filter added the content then the Filter can/should/must wrap
the request and modify the content length header.

> 2) Support for the "Content-Range" header will be broken. (Unless
> turned off in DefaultServlet configuration).

Again, assuming a Filter added the content then the Filter would have to
wrap the response and modify the Content-Range headers.

Having a filter that modifies content but works with any servlet is
going to be tricky to get absolutely right. It would be a lot easier if
it only has to work with a set of known servlets where most/all of the
issues can be ignored.

There are probably other issues that would need to be taken into
consideration too. Fortunately, this is an intellectual exercise rather
than a problem we have to solve in Tomcat. Still, it is an interesting
exercise.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to