Skip to content

Commit b2464a7

Browse files
committed
fixup! comment
1 parent f70da90 commit b2464a7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/open-next/src/http/util.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ export function parseSetCookieHeader(
4141
return [];
4242
}
4343

44-
return typeof cookies === "string"
45-
? cookies.split(/(?<!Expires=\w+),/i).map((c) => c.trim())
46-
: cookies;
44+
if (typeof cookies === "string") {
45+
// Split the cookie string on ",".
46+
// Note that "," can also appear in the Expires value (i.e. `Expires=Thu, 01 June`)
47+
// so we have to skip it with a negative lookbehind.
48+
return cookies.split(/(?<!Expires=\w+),/i).map((c) => c.trim());
49+
}
50+
51+
return cookies;
4752
}
4853

4954
/**

0 commit comments

Comments
 (0)