Uploaded image for project: 'Nuxeo Java Client'
  1. Nuxeo Java Client
  2. JAVACLIENT-218

Fix encoding issue with header values which contain non ASCII character

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.11.0
    • Component/s: REST
    • Backlog priority:
      600
    • Team:
      PLATFORM
    • Sprint:
      nxplatform #36, nxplatform #37
    • Story Points:
      0

      Description

      Since JAVACLIENT-183 and the update of okhttp from 3.9.1 to 3.12.1, it has introduces a check on header values.

      If a filename with non ASCII characters is used in a header (Content-Disposition for example), it will crash with this exception

      Exception in thread "main" java.lang.IllegalArgumentException: Unexpected char 0xe2 at 60 in Content-Disposition value: form-data; name="input#0"; filename="Bâtiment.pdf"
      	at okhttp3.Headers.checkValue(Headers.java:272)
      	at okhttp3.Headers.of(Headers.java:224)
      	at okhttp3.MultipartBody$Part.createFormData(MultipartBody.java:259)
      	at org.nuxeo.client.objects.Operation.getCallToExecute(Operation.java:130)
      	at org.nuxeo.client.objects.Operation.execute(Operation.java:108)
      	at org.nuxeo.TestFetch.main(TestFetch.java:29)
      

      If I understand correctly the problem, we should URL encode the filename in the java client and then URL decode server side, so maybe a NXP ticket is also needed

      Using Java client 3.2.0 is a workaround.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: