Skip to content

Commit 282295c

Browse files
jlberrocalvalorkin
authored andcommitted
feat(file-upload): Add the possibility of set the token header (#213)
It will be very useful set which is the Token that is going to be send to the server
1 parent 1a4eb3a commit 282295c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

components/file-upload/file-uploader.class.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export class FileUploader {
5959
this.options = Object.assign(this.options, options);
6060

6161
this.authToken = options.authToken;
62+
this.authTokenHeader = options.authTokenHeader || 'Authorization';
6263
this.autoUpload = options.autoUpload;
6364
this.options.filters.unshift({name: 'queueLimit', fn: this._queueLimitFilter});
6465

@@ -344,7 +345,7 @@ export class FileUploader {
344345
}
345346
}
346347
if (this.authToken) {
347-
xhr.setRequestHeader('Authorization', this.authToken);
348+
xhr.setRequestHeader(this.authTokenHeader, this.authToken);
348349
}
349350
xhr.send(sendable);
350351
this._render();

0 commit comments

Comments
 (0)