Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16452

Align MultiPart request parsing in Automation and Batch upload (WebEngine)

    Details

      Description

      We parse MultiPart request in 2 different ways:

      • In Automation, it uses MultiPartRequestReader and MultiPartFormRequestReader classes, which use javax.mail.*.
      • In Batch Upload (and WebEngine), it uses FormData, which use Apache Commons Fileupload.

      We have an issue on the filename, when it contains other characters than the one in US-ASCII.

      Commons Fileupload reads correctly encoded filename in the header, as it uses UTF-8 encoding by default.

      However, javax.mail seems to fail at it, it cannot decode correctly the filename. To make it correctly decode the filename, we should use {{ filename*=UTF-8''}} in the part header:

      ...
      form-data; name="file"; filename*=UTF-8''blablaéèôûü__.txt
      ...
      

      Browsers (at least Chrome and Firefox) send only filename in the part header:

      ...
      form-data; name="file"; filename="blablaéèôûü__.txt"
      ...
      

      => We should probably align all the code to use Apache Commons Fileupload to parse MultiPart requests, and make sure we send correctly encoded part headers.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              troger Thomas Roger
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                PagerDuty

                Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.