[jetty-dev] [jira] (JETTY-1532) HTTP headers decoded with platform's default encoding
"Dawid Weiss (JIRA)" <[email protected]> Fri, 6 Jul 2012 05:22:21 -0500 (CDT)
| Newsgroups | gmane.comp.java.jetty.general |
|---|---|
| Message-ID | <1561237368.22155.1341570141088.JavaMail.j2ee-jira@codehaus01.managed.contegix.com> |
Dawid Weiss created JETTY-1532 HTTP headers decoded with platform's default encoding Issue Type: Bug Affects Versions: 8.1.2 Assignee: Unassigned Components: HTTP Created: 06/Jul/12 5:21 AM Description: Affects 8.1.2 and possibly later, didn't check. Set the platform encoding to -Dfile.encoding=UTF-16 (I'm dodging the question if this is a valid configuration for now). This reveals bugs with dependencies on default platform encoding, for example HTTP's content-type/ charset is decoded via call to MimeTypes#getCharsetFromContentType(Buffer) where it traverses the buffer assuming it is US-ASCII (which makes sense), but then does: return CACHE.lookup(value.peek(start,i-start)).toString(); This is repeated in two places. Buffer's default toString() uses platform encoding so this will be screwed up if the content's US-ASCII characters don't align perfectly with it (ebcdic, UTF-16, etc.). There is no workaround. A fix is to decode with US-ASCII as HTTP headers should be in this encoding. Project: Jetty Priority: Trivial Reporter: Dawid Weiss This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators . For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email