You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by lu...@apache.org on 2004/08/23 21:22:20 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 CoyoteResponse.java

luehe       2004/08/23 12:22:20

  Modified:    catalina/src/share/org/apache/coyote/tomcat5 Tag: TOMCAT_5_0
                        CoyoteResponse.java
  Log:
  Ported fix for Bugtraq 6152759 ("Default charset not included in Content-Type
  response header if no char encoding was specified") from HEAD
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.18.2.1  +15 -1     jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/Attic/CoyoteResponse.java
  
  Index: CoyoteResponse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/Attic/CoyoteResponse.java,v
  retrieving revision 1.18
  retrieving revision 1.18.2.1
  diff -u -r1.18 -r1.18.2.1
  --- CoyoteResponse.java	17 Jun 2004 01:08:08 -0000	1.18
  +++ CoyoteResponse.java	23 Aug 2004 19:22:20 -0000	1.18.2.1
  @@ -599,6 +599,20 @@
               throw new IllegalStateException
                   (sm.getString("coyoteResponse.getWriter.ise"));
   
  +        /*
  +         * If the response's character encoding has not been specified as
  +         * described in <code>getCharacterEncoding</code> (i.e., the method
  +         * just returns the default value <code>ISO-8859-1</code>),
  +         * <code>getWriter</code> updates it to <code>ISO-8859-1</code>
  +         * (with the effect that a subsequent call to getContentType() will
  +         * include a charset=ISO-8859-1 component which will also be
  +         * reflected in the Content-Type response header, thereby satisfying
  +         * the Servlet spec requirement that containers must communicate the
  +         * character encoding used for the servlet response's writer to the
  +         * client).
  +         */
  +        setCharacterEncoding(getCharacterEncoding());
  +
           usingWriter = true;
           outputBuffer.checkConverter();
           if (writer == null) {
  
  
  

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