Uppy: handle xhr missing a 'getResponseHeader' method

Created on 19 Feb 2018  路  4Comments  路  Source: transloadit/uppy

When using the Aws S3 plugin, the file uploads successfully (is available in our bucket), however an error throws in the console before the UI can update.

We've traced this error to the isXML function inside of the Aws S3 plugin.

function isXml (xhr) {
  const contentType = xhr.getResponseHeader('Content-Type')
  return typeof contentType === 'string' && contentType.toLowerCase() === 'application/xml'
}

instead of being passed an xhr object, this function is passed an xml string in the form:

<PostResponse><Location>https://s3.region.amazonaws.com/my-bucket/subfolder/my-file.pdf</Location><Bucket>my-bucket</Bucket><Key>subfolder-uploads/1519005969144-my-file.pdf</Key><ETag>"e-tag-here"</ETag></PostResponse>

this obviously is missing the getResponseHeader method.

AWS S3 Bug

Most helpful comment

Sorry about this! This is fixed by #625. We should publish a patch release today so you can actually use it.

All 4 comments

Sorry about this! This is fixed by #625. We should publish a patch release today so you can actually use it.

Please provide a patch release.

Done, sorry for the wait, 0.23.1: https://www.npmjs.com/package/uppy

Please re-open if the issue persists.

Was this page helpful?
0 / 5 - 0 ratings