Fix handling of cookies for absolute domains (#50)

This commit is contained in:
Chrisliebär 2025-01-28 04:23:00 +01:00 committed by GitHub
parent f5152a4717
commit ea12e6bc08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -195,9 +195,12 @@ async function cookieStr(cookieLines) {
} }
function buildCookieLine(cookie) { function buildCookieLine(cookie) {
// 2nd argument controls subdomains, and must match leading dot in domain
let includeSubdomains = cookie.domain.startsWith('.') ? 'TRUE' : 'FALSE';
return [ return [
cookie.domain, cookie.domain,
'TRUE', includeSubdomains,
cookie.path, cookie.path,
cookie.httpOnly.toString().toUpperCase(), cookie.httpOnly.toString().toUpperCase(),
Math.trunc(cookie.expirationDate) || 0, Math.trunc(cookie.expirationDate) || 0,