fix(api): make cookie recognition during websocket connection more

robust
This commit is contained in:
Pujit Mehrotra
2025-02-03 13:09:15 -05:00
committed by Eli Bosley
parent 6bb3d55e3c
commit 2a82ea4765

View File

@@ -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);
}