Uploaded image for project: 'Nuxeo JS Client'
  1. Nuxeo JS Client
  2. NXJS-139

Authorization header is sent when redirecting to a different host

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.7.0
    • Component/s: Node.js
    • Tags:
    • Sprint:
      nxfit 10.2.5, nxfit 10.2.6
    • Story Points:
      2

      Description

      The library we use (node-fetch) does not strip Authorization header when doing a redirect to a different host.
      This lead to the following issue:

        ...
        doc
          .fetchBlob()
          .then(res => {
            debug('Downloaded asset', res);
            res.body.pipe(fs.createWriteStream(local_path));
          })
          .catch(err => {
             error('File save err: ', err);
          });
      

      If that code redirects to s3 for instance, we end up with a 400

      <?xml version="1.0" encoding="UTF-8"?>
      <Error><Code>InvalidArgument</Code><Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message><ArgumentName>Authorization</ArgumentName><ArgumentValue>Basic XXXX</ArgumentValue><RequestId>XXXX</RequestId><HostId>XXXX=</HostId></Error>
      

      What could be tried:

        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 - 30 minutes
                  30m