fix: Match Bearer case-insensitively and trim whitespace(s)
This commit is contained in:
+1
-1
@@ -121,7 +121,7 @@ export class Api {
|
||||
}
|
||||
|
||||
// try authorization header
|
||||
const headerToken = this.options.headers.get("authorization")?.replace("Bearer ", "");
|
||||
const headerToken = this.options.headers.get("authorization")?.replace(/^Bearer\s+/i, "");
|
||||
if (headerToken) {
|
||||
this.token_transport = "header";
|
||||
this.updateToken(headerToken);
|
||||
|
||||
Reference in New Issue
Block a user