From 4bf250c58e9ee9bf56a0babb8e29e95cccee4f04 Mon Sep 17 00:00:00 2001 From: Matteo Ciccone Date: Mon, 10 Jun 2024 13:10:20 +0200 Subject: [PATCH] fix: [#1455] Cookie container cache key --- packages/happy-dom/src/cookie/CookieContainer.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/happy-dom/src/cookie/CookieContainer.ts b/packages/happy-dom/src/cookie/CookieContainer.ts index 4d36b864f..27063f3f4 100644 --- a/packages/happy-dom/src/cookie/CookieContainer.ts +++ b/packages/happy-dom/src/cookie/CookieContainer.ts @@ -21,9 +21,7 @@ export default class CookieContainer implements ICookieContainer { public addCookies(cookies: ICookie[]): void { const indexMap: { [k: string]: number } = {}; const getKey = (cookie: ICookie): string => - `${cookie.key}-${cookie.originURL.hostname}-${ - cookie.originURL.pathname - }-${typeof cookie.value}`; + `${cookie.key}-${cookie.originURL.hostname}-${cookie.path}-${typeof cookie.value}`; // Creates a map of cookie key, domain, path and value to index. for (let i = 0, max = this.#cookies.length; i < max; i++) {