diff --git a/src/set-cookie/parse.ts b/src/set-cookie/parse.ts index 224ce5f..31451d5 100644 --- a/src/set-cookie/parse.ts +++ b/src/set-cookie/parse.ts @@ -57,7 +57,7 @@ export function parseSetCookie( break; } case "samesite": { - cookie.sameSite = partValue; + cookie.sameSite = partValue as SetCookie["sameSite"]; break; } default: { diff --git a/src/set-cookie/types.ts b/src/set-cookie/types.ts index 134af60..965389c 100644 --- a/src/set-cookie/types.ts +++ b/src/set-cookie/types.ts @@ -56,7 +56,7 @@ export interface SetCookie { /** * Indicates a cookie ought not to be sent along with cross-site requests */ - sameSite?: string | undefined; + sameSite?: true | false | "lax" | "strict" | "none" | undefined; [key: string]: unknown; }