Browse Source

Merge pull request #544 from transloadit/fix/s3-is-xml

s3: fix isXml() check when no content-type is available
Artur Paikin 7 years ago
parent
commit
212639d12e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/plugins/AwsS3/index.js

+ 2 - 1
src/plugins/AwsS3/index.js

@@ -3,7 +3,8 @@ const Translator = require('../../core/Translator')
 const XHRUpload = require('../XHRUpload')
 
 function isXml (xhr) {
-  return xhr.getResponseHeader('Content-Type').toLowerCase() === 'application/xml'
+  const contentType = xhr.getResponseHeader('Content-Type')
+  return typeof contentType === 'string' && contentType.toLowerCase() === 'application/xml'
 }
 
 module.exports = class AwsS3 extends Plugin {