|
@@ -14,7 +14,7 @@ module.exports = class RequestClient {
|
|
this.uppy = uppy
|
|
this.uppy = uppy
|
|
this.opts = opts
|
|
this.opts = opts
|
|
this.onReceiveResponse = this.onReceiveResponse.bind(this)
|
|
this.onReceiveResponse = this.onReceiveResponse.bind(this)
|
|
- this.allowedHeaders = []
|
|
|
|
|
|
+ this.allowedHeaders = ['accept', 'content-type']
|
|
this.preflightDone = false
|
|
this.preflightDone = false
|
|
}
|
|
}
|
|
|
|
|
|
@@ -93,9 +93,8 @@ module.exports = class RequestClient {
|
|
})
|
|
})
|
|
.then((response) => {
|
|
.then((response) => {
|
|
if (response.headers.has('access-control-allow-headers')) {
|
|
if (response.headers.has('access-control-allow-headers')) {
|
|
- const allowedHeaders = response.headers.get('access-control-allow-headers')
|
|
|
|
|
|
+ this.allowedHeaders = response.headers.get('access-control-allow-headers')
|
|
.split(',').map((headerName) => headerName.trim().toLowerCase())
|
|
.split(',').map((headerName) => headerName.trim().toLowerCase())
|
|
- this.allowedHeaders = this.allowedHeaders.concat(allowedHeaders)
|
|
|
|
}
|
|
}
|
|
this.preflightDone = true
|
|
this.preflightDone = true
|
|
resolve(this.allowedHeaders.slice())
|
|
resolve(this.allowedHeaders.slice())
|