From 2a82ea476560aae80ef01c0cf28b482dcd1f40cf Mon Sep 17 00:00:00 2001 From: Pujit Mehrotra Date: Mon, 3 Feb 2025 13:09:15 -0500 Subject: [PATCH] fix(api): make cookie recognition during websocket connection more robust --- api/src/unraid-api/auth/auth.guard.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/unraid-api/auth/auth.guard.ts b/api/src/unraid-api/auth/auth.guard.ts index 2a4f026ec..1db228b3e 100644 --- a/api/src/unraid-api/auth/auth.guard.ts +++ b/api/src/unraid-api/auth/auth.guard.ts @@ -87,7 +87,9 @@ export class GraphqlAuthGuard // parse cookies from raw headers on initial web socket connection request if (fullContext.connectionParams) { const rawHeaders = fullContext.req.extra.request.rawHeaders; - const headerIndex = rawHeaders.findIndex((headerOrValue) => headerOrValue === 'Cookie'); + const headerIndex = rawHeaders.findIndex( + (headerOrValue) => headerOrValue.toLowerCase() === 'cookie' + ); const cookieString = rawHeaders[headerIndex + 1]; request.cookies = parseCookies(cookieString); }