Skip to content

Commit

Permalink
feat(file-upload): Add the possibility of set the token header (#213)
Browse files Browse the repository at this point in the history
It will be very useful set which is the Token that is going to be send to the server
  • Loading branch information
jlberrocal authored and valorkin committed Oct 19, 2016
1 parent 1a4eb3a commit 282295c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/file-upload/file-uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class FileUploader {
this.options = Object.assign(this.options, options);

this.authToken = options.authToken;
this.authTokenHeader = options.authTokenHeader || 'Authorization';
this.autoUpload = options.autoUpload;
this.options.filters.unshift({name: 'queueLimit', fn: this._queueLimitFilter});

Expand Down Expand Up @@ -344,7 +345,7 @@ export class FileUploader {
}
}
if (this.authToken) {
xhr.setRequestHeader('Authorization', this.authToken);
xhr.setRequestHeader(this.authTokenHeader, this.authToken);
}
xhr.send(sendable);
this._render();
Expand Down

0 comments on commit 282295c

Please sign in to comment.