tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42119] New: - request.getCharacterEncoding misparses charset=UTF-8; xyz=3
Date Fri, 13 Apr 2007 19:01:03 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42119>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42119

           Summary: request.getCharacterEncoding misparses charset=UTF-8;
                    xyz=3
           Product: Tomcat 5
           Version: 5.5.23
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Connector:Coyote
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: leigh.klotz@xerox.com


(This bug is also present in Coyote source 6.0.10.)

If there is an HTTP header
 Content-Type: text/abc; charset=UTF-8; xyz=3
request.getCharacterEncoding() returns "UTF-8; xyz=3" but Tomcat 4.1.24 returns
"UTF-8".

In Tomcat 4.1.24, request.getCharacterEncoding uses parseCharacterEncoding
defined in
 
jakarta-tomcat-4.1.24-src/catalina/src/share/org/apache/catalina/util/RequestUtil.java

and it correctly handles the case of other Content-Type parameters.

In Tomcat 5.5.23, however, request.getCharacterEncoding uses
getCharsetFromContentType defined in 
from
apache-tomcat-5.5.23-src/connectors/util/java/org/apache/tomcat/util/http/ContentType.java

which does not search for a possible terminating semicolon in the charset, thus
erroneously including additional characters in the charset.

The code in 5.5.23 has a comment begins
     // Basically return everything after ";charset="

Please consider using the code from 4.1.24

This problem showed up when Content-Type was multipart/mixed and a client
specified a charset parameter to Content-Type; however, it will occur in any
Content-Type where charset is specified and is not the last parameter.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message