tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Processor.java
Date Wed, 28 Jul 2004 09:32:07 GMT
luehe@apache.org wrote:

>luehe       2004/07/27 17:43:44
>
>  Modified:    http11/src/java/org/apache/coyote/http11
>                        Http11Processor.java
>  Log:
>  Fixed Bugtraq 6152759 ("Default charset not included in Content-Type
>  response header if no char encoding was specified").
>  
>  According to the Servlet 2.4 spec, calling:
>  
>    ServletResponse.setContentType("text/html");
>  
>  must yield these results:
>  
>    ServletResponse.getContentType() -> "text/html"
>  
>    Content-Type response header -> "text/html;charset=ISO-8859-1"
>  
>  Notice the absence of a charset in the result of getContentType(), but
>  its presence (set to the default ISO-8859-1) in the Content-Type
>  response header.
>  
>  Tomcat is currently not including the default charset in the
>  Content-Type response header if no char encoding was specified.
>  
>  Revision  Changes    Path
>  1.101     +1 -1      jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
>  
>  Index: Http11Processor.java
>  ===================================================================
>  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java,v
>  retrieving revision 1.100
>  retrieving revision 1.101
>  diff -u -r1.100 -r1.101
>  --- Http11Processor.java	1 Jun 2004 14:34:22 -0000	1.100
>  +++ Http11Processor.java	28 Jul 2004 00:43:44 -0000	1.101
>  @@ -1450,7 +1450,7 @@
>           if (!entityBody) {
>               response.setContentLength(-1);
>           } else {
>  -            String contentType = response.getContentType();
>  +            String contentType = response.getContentTypeResponseHeader();
>               if (contentType != null) {
>                   headers.setValue("Content-Type").setString(contentType);
>               }
>  
>
Cool. So after all the efforts I'm doing to optimize, you casually add 
GC, because the servlet API is completely stupid ?
So -1 for your patch: you need to rework it. I also didn't read all that 
funny stuff in the specification, so where does it come from ? ;)

Rémy


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


Mime
View raw message