Skip to content

Commit bcab190

Browse files
committed
fix(api): make cookie recognition during websocket connection more
robust
1 parent 846574b commit bcab190

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/src/unraid-api/auth/auth.guard.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ export class GraphqlAuthGuard
8787
// parse cookies from raw headers on initial web socket connection request
8888
if (fullContext.connectionParams) {
8989
const rawHeaders = fullContext.req.extra.request.rawHeaders;
90-
const headerIndex = rawHeaders.findIndex((headerOrValue) => headerOrValue === 'Cookie');
90+
const headerIndex = rawHeaders.findIndex(
91+
(headerOrValue) => headerOrValue.toLowerCase() === 'cookie'
92+
);
9193
const cookieString = rawHeaders[headerIndex + 1];
9294
request.cookies = parseCookies(cookieString);
9395
}

0 commit comments

Comments
 (0)