瀏覽代碼

don’t set responseType if it’s empty string, because ie10 was failing with empty string

//cc @goto-bus-stop

IE10 was failing after https://github.com/transloadit/uppy/pull/1150
Artur Paikin 6 年之前
父節點
當前提交
c841e242a2
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      packages/@uppy/xhr-upload/src/index.js

+ 6 - 2
packages/@uppy/xhr-upload/src/index.js

@@ -202,7 +202,9 @@ module.exports = class XHRUpload extends Plugin {
       })
 
       const xhr = new XMLHttpRequest()
-      xhr.responseType = opts.responseType
+      if (opts.responseType !== '') {
+        xhr.responseType = opts.responseType
+      }
 
       const id = cuid()
 
@@ -360,7 +362,9 @@ module.exports = class XHRUpload extends Plugin {
       })
 
       const xhr = new XMLHttpRequest()
-      xhr.responseType = this.opts.responseType
+      if (this.opts.responseType !== '') {
+        xhr.responseType = this.opts.responseType
+      }
 
       const timer = this.createProgressTimeout(this.opts.timeout, (error) => {
         xhr.abort()