Skip to content

Commit bb9e894

Browse files
committed
fix: correct domain/ hostOnly configuration
1 parent ee326b7 commit bb9e894

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/factories/createToughCookiePayloadFromPuppeteerCookies.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export default (cookies: $ReadOnlyArray<PuppeteerCookieType>): ToughCookiePayloa
1010
cookies: cookies.map((cookie) => {
1111
return {
1212
creation: new Date().toISOString(),
13-
domain: cookie.domain,
13+
domain: cookie.domain.replace(/^\./, ''),
1414
expires: cookie.expires === -1 ? Infinity : new Date(cookie.expires * 1000).toISOString(),
15-
hostOnly: true,
15+
hostOnly: !cookie.domain.startsWith('.'),
1616
httpOnly: cookie.httpOnly,
1717
key: cookie.name,
1818
lastAccessed: new Date().toISOString(),

0 commit comments

Comments
 (0)