From b3bafcf25f6809e456c9c438bca187e27fd706bc Mon Sep 17 00:00:00 2001 From: getlarge Date: Mon, 7 Oct 2024 11:51:34 +0200 Subject: [PATCH] fix: update authorization header parsing to be case-insensitive --- .../kratos-client-wrapper/src/lib/ory-authentication.guard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kratos-client-wrapper/src/lib/ory-authentication.guard.ts b/packages/kratos-client-wrapper/src/lib/ory-authentication.guard.ts index 16b01bd..8981605 100644 --- a/packages/kratos-client-wrapper/src/lib/ory-authentication.guard.ts +++ b/packages/kratos-client-wrapper/src/lib/ory-authentication.guard.ts @@ -45,7 +45,7 @@ const defaultOptions: OryAuthenticationGuardOptions = { ctx .switchToHttp() .getRequest() - ?.headers?.authorization?.replace('Bearer ', ''), + ?.headers?.authorization?.replace(/bearer/i, ''), cookieResolver: (ctx) => ctx.switchToHttp().getRequest()?.headers?.cookie, unauthorizedFactory() { return new UnauthorizedException();