mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 11:14:05 +00:00
@uppy/xhr-upload: replace ev.target.status with xhr.status (#3782)
This commit is contained in:
parent
76751f6f4f
commit
aa1ecd4d60
1 changed files with 4 additions and 4 deletions
|
|
@ -251,7 +251,7 @@ export default class XHRUpload extends BasePlugin {
|
|||
}
|
||||
})
|
||||
|
||||
xhr.addEventListener('load', (ev) => {
|
||||
xhr.addEventListener('load', () => {
|
||||
this.uppy.log(`[XHRUpload] ${id} finished`)
|
||||
timer.done()
|
||||
queuedRequest.done()
|
||||
|
|
@ -260,12 +260,12 @@ export default class XHRUpload extends BasePlugin {
|
|||
this.uploaderEvents[file.id] = null
|
||||
}
|
||||
|
||||
if (opts.validateStatus(ev.target.status, xhr.responseText, xhr)) {
|
||||
if (opts.validateStatus(xhr.status, xhr.responseText, xhr)) {
|
||||
const body = opts.getResponseData(xhr.responseText, xhr)
|
||||
const uploadURL = body[opts.responseUrlFieldName]
|
||||
|
||||
const uploadResp = {
|
||||
status: ev.target.status,
|
||||
status: xhr.status,
|
||||
body,
|
||||
uploadURL,
|
||||
}
|
||||
|
|
@ -282,7 +282,7 @@ export default class XHRUpload extends BasePlugin {
|
|||
const error = buildResponseError(xhr, opts.getResponseError(xhr.responseText, xhr))
|
||||
|
||||
const response = {
|
||||
status: ev.target.status,
|
||||
status: xhr.status,
|
||||
body,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue