-
Bug
-
Resolution: Done
-
Major
-
1.2.8.Final
-
None
-
None
- MultiPartUploadHandler doesn't use defaultEncoding and instead gets encoding from the HTTP request.
The issue:
- When you send data via JavaScript using XMLHttpRequest and FormData the request is encoded as UTF-8 (this cannot be changed and the charset isn't specified since that is the default) as a result the MultipartParser will use the HTTP default which is ISO-8859-1
- The server default can be changed by adding e.g. <default-encoding>UTF-8</default-encoding> to jboss-web.xml, this changes the defaultEncoding of the parser
- Since the MultiPartUploadHandler ignores this setting the request is still parsed by iso-8859-1 however request.getCharacterEncoding() will return "UTF-8"
Simple reproducer, executable from console
fd = new FormData(); fd.append("ěščř",""); xhr = new XMLHttpRequest(); xhr.open('POST', ""); xhr.send(fd);