Skip to content

Commit e4a7099

Browse files
retrospectacusvalorkin
authored andcommitted
fix(headers): Add FileItem headers to XHR (#553)
fixes #552
1 parent 34c0d35 commit e4a7099

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

components/file-upload/file-uploader.class.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,16 @@ export class FileUploader {
337337
};
338338
xhr.open(item.method, item.url, true);
339339
xhr.withCredentials = item.withCredentials;
340-
// todo
341-
/*item.headers.map((value, name) => {
342-
xhr.setRequestHeader(name, value);
343-
});*/
344340
if (this.options.headers) {
345341
for (let header of this.options.headers) {
346342
xhr.setRequestHeader(header.name, header.value);
347343
}
348344
}
345+
if (item.headers.length) {
346+
for (let header of item.headers) {
347+
xhr.setRequestHeader(header.name, header.value);
348+
}
349+
}
349350
if (this.authToken) {
350351
xhr.setRequestHeader(this.authTokenHeader, this.authToken);
351352
}

0 commit comments

Comments
 (0)