Skip to content

Commit

Permalink
fix(headers): Add FileItem headers to XHR (valor-software#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
retrospectacus authored and valorkin committed Jan 17, 2017
1 parent 34c0d35 commit e4a7099
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/file-upload/file-uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e4a7099

Please sign in to comment.