2012/6/28 <markt@apache.org>:
> Author: markt
> Date: Thu Jun 28 07:55:13 2012
> New Revision: 1354847
>
> URL: http://svn.apache.org/viewvc?rev=1354847&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53454
> Return correct content-length header for HEAD requests when value is > 2GB
>
> Added:
> tomcat/trunk/test/javax/servlet/http/
> tomcat/trunk/test/javax/servlet/http/TestHttpServlet.java (with props)
> Modified:
> tomcat/trunk/java/javax/servlet/http/HttpServlet.java
> tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
1. Maybe use response.getHeader() method added in Servlet 3.0?
There is setIntHeader() method and add*Header methods.
2. Trunk needs an additional fix for Servlet 3.1,
as there will be setContentLengthLong() method as was recently added to trunk.
>
> Modified: tomcat/trunk/java/javax/servlet/http/HttpServlet.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServlet.java?rev=1354847&r1=1354846&r2=1354847&view=diff
> ==============================================================================
> --- tomcat/trunk/java/javax/servlet/http/HttpServlet.java (original)
> +++ tomcat/trunk/java/javax/servlet/http/HttpServlet.java Thu Jun 28 07:55:13 2012
> @@ -758,6 +758,14 @@ class NoBodyResponse extends HttpServlet
> }
>
> @Override
> + public void setHeader(String name, String value) {
> + super.setHeader(name, value);
> + if ("content-length".equalsIgnoreCase(name)) {
> + didSetContentLength = true;
> + }
> + }
> +
> + @Override
> public ServletOutputStream getOutputStream() throws IOException {
> return noBody;
> }
>(...)
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
|