fix(headers): Add FileItem headers to XHR (#553)
fixes #552
This commit was merged in pull request #553.
This commit is contained in:
committed by
Dmitriy Shekhovtsov
parent
34c0d35c9c
commit
e4a7099d92
@@ -337,15 +337,16 @@ export class FileUploader {
|
||||
};
|
||||
xhr.open(item.method, item.url, true);
|
||||
xhr.withCredentials = item.withCredentials;
|
||||
// todo
|
||||
/*item.headers.map((value, name) => {
|
||||
xhr.setRequestHeader(name, value);
|
||||
});*/
|
||||
if (this.options.headers) {
|
||||
for (let header of this.options.headers) {
|
||||
xhr.setRequestHeader(header.name, header.value);
|
||||
}
|
||||
}
|
||||
if (item.headers.length) {
|
||||
for (let header of item.headers) {
|
||||
xhr.setRequestHeader(header.name, header.value);
|
||||
}
|
||||
}
|
||||
if (this.authToken) {
|
||||
xhr.setRequestHeader(this.authTokenHeader, this.authToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user