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

Drive: test bad mime type detected by the client and sent to the server

    XMLWordPrintable

    Details

      Description

      In some cases, the call to mimetypes.guess_type(filename) in base_automation_client.upload() returns a bad mime type.
      For example, on Windows, the mime type guesser uses the registry and might return "pdf" instead of "application/pdf", don't really know why...

      Since NXP-13036 the WebEngineServlet should detect this and patch the "X-File-Type" HTTP header to add the missing "application/" part if missing, thus avoiding:

      [org.nuxeo.ecm.automation.server.jaxrs.batch.BatchResource] Error while executing automation batch
      ...
      Caused by: javax.mail.internet.ParseException: Expected '/', got null
      at javax.mail.internet.ContentType.<init>(ContentType.java:102)
      at org.nuxeo.drive.operations.NuxeoDriveOperationHelper.normalizeMimeTypeAndEncoding(NuxeoDriveOperationHelper.java:55)
      ...
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h