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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user