Uploaded image for project: 'Nuxeo Documentation'
  1. Nuxeo Documentation
  2. NXDOC-1823

Fix S3 cors config for async download

    XMLWordPrintable

    Details

      Description

      Getting this error with CSV export on a server which uses S3 for storage

      Uncaught (in promise) Error: missing Content-Disposition header
         at HTMLElement._download (elements.html:12900)
         at $.op.execute.then (elements.html:12862)
      

      Happens here: https://github.com/nuxeo/nuxeo-ui-elements/blob/554fdaf3ecb5b3a137af6481b5cc7e8a9978051e/widgets/nuxeo-operation-button.html#L204

      in this case the server response is a redirect which does not contain the Content-Disposition header

      response: Response
      body: (...)
      bodyUsed: false
      headers: Headers {}
      ok: true
      redirected: true
      status: 200
      statusText: "OK"
      type: "cors"
      url: "https://...-bucket.s3.ap-northeast-1.amaz ...
      

      The element should follow the redirect.

      EDIT
      the redirection is done, it is just that the transient_automation store is now stored on the s3 default bucket and since CSV export and Bulk Download happens in an XHR context, we now need a specific cors-config on the s3 bucket to expose the needed header in order that the download goes through.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 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 - 3 hours
                  3h