mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
xhrupload: Move .withCredentials assignment to after open()
IE 10 doesn't allow setting it before open() is called.
This commit is contained in:
parent
446a0f0b08
commit
2698b599d7
1 changed files with 4 additions and 2 deletions
|
|
@ -203,8 +203,6 @@ module.exports = class XHRUpload extends Plugin {
|
|||
const xhr = new XMLHttpRequest()
|
||||
const id = cuid()
|
||||
|
||||
xhr.withCredentials = opts.withCredentials
|
||||
|
||||
xhr.upload.addEventListener('loadstart', (ev) => {
|
||||
this.uppy.log(`[XHRUpload] ${id} started`)
|
||||
// Begin checking for timeouts when loading starts.
|
||||
|
|
@ -274,6 +272,8 @@ module.exports = class XHRUpload extends Plugin {
|
|||
|
||||
xhr.open(opts.method.toUpperCase(), opts.endpoint, true)
|
||||
|
||||
xhr.withCredentials = opts.withCredentials
|
||||
|
||||
Object.keys(opts.headers).forEach((header) => {
|
||||
xhr.setRequestHeader(header, opts.headers[header])
|
||||
})
|
||||
|
|
@ -430,6 +430,8 @@ module.exports = class XHRUpload extends Plugin {
|
|||
|
||||
xhr.open(method.toUpperCase(), endpoint, true)
|
||||
|
||||
xhr.withCredentials = this.opts.withCredentials
|
||||
|
||||
Object.keys(this.opts.headers).forEach((header) => {
|
||||
xhr.setRequestHeader(header, this.opts.headers[header])
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue