Add the possibility of stablish the token header

It will be very useful set which is the Token that is going to be send to the server
This commit is contained in:
Jose Berrocal
2016-05-20 12:01:29 -06:00
parent 4f13f2e356
commit 8d8af73fb0

View File

@@ -50,6 +50,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});
@@ -326,7 +327,7 @@ export class FileUploader {
}
}
if (this.authToken) {
xhr.setRequestHeader('Authorization', this.authToken);
xhr.setRequestHeader(this.authTokenHeader, this.authToken);
}
xhr.send(form);
this._render();