Procházet zdrojové kódy

fix bug.
fix style.

b1ncer před 6 roky
rodič
revize
0329775065
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      src/plugins/XHRUpload.js

+ 4 - 2
src/plugins/XHRUpload.js

@@ -203,8 +203,8 @@ module.exports = class XHRUpload extends Plugin {
       const xhr = new XMLHttpRequest()
       const id = cuid()
 
-      xhr.withCredentials = this.opts.withCredentials
-      
+      xhr.withCredentials = opts.withCredentials
+
       xhr.upload.addEventListener('loadstart', (ev) => {
         this.uppy.log(`[XHRUpload] ${id} started`)
         // Begin checking for timeouts when loading starts.
@@ -365,6 +365,8 @@ module.exports = class XHRUpload extends Plugin {
 
       const xhr = new XMLHttpRequest()
 
+      xhr.withCredentials = this.opts.withCredentials
+
       const timer = this.createProgressTimeout(this.opts.timeout, (error) => {
         xhr.abort()
         emitError(error)