fix: Match Bearer case-insensitively and trim whitespace(s)

This commit is contained in:
Jonas Perusquia Morales
2026-03-24 12:20:17 -06:00
parent feb3911d46
commit 4121597fa2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -430,7 +430,7 @@ export class Authenticator<
let token: string | undefined;
if (headers.has("Authorization")) {
const bearerHeader = String(headers.get("Authorization"));
token = bearerHeader.replace("Bearer ", "");
token = bearerHeader.replace(/^Bearer\s+/i, "");
} else {
const context = is_context ? (c as Context) : ({ req: { raw: { headers } } } as Context);
token = await this.getAuthCookie(context);