Add the possibility of stablish the token header #213

Merged
jlberrocal merged 1 commits from patch-1 into development 2016-10-19 10:45:02 +00:00
Showing only changes of commit 8d8af73fb0 - Show all commits

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();