Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-503

MultiPartUploadHandler ignores default encoding

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.2.8.Final
    • Fix Version/s: 1.2.10.Final, 1.3.0.Beta6
    • Component/s: None
    • Labels:
      None

      Description

      MultiPartParserDefinition:192

      • 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);
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  swd847 Stuart Douglas
                  Reporter:
                  michpetrov Michal Petrov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: