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

MultiPartUploadHandler ignores default encoding

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.2.10.Final, 1.3.0.Beta6
    • 1.2.8.Final
    • None
    • 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);
      

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            mpetrov@redhat.com Michal Petrov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: