happy-dom
Advanced tools
Comparing version 15.10.6 to 15.10.7
@@ -15,7 +15,10 @@ import CookieSameSiteEnum from '../enums/CookieSameSiteEnum.js'; | ||
const parts = cookieString.split(';'); | ||
const [key, value] = parts.shift().split('='); | ||
const part = parts.shift(); | ||
const index = part.indexOf('='); | ||
const key = index !== -1 ? part.slice(0, index).trim() : part.trim(); | ||
const value = index !== -1 ? part.slice(index + 1).trim() : null; | ||
const cookie = { | ||
// Required | ||
key: key.trim(), | ||
value: value ?? null, | ||
key, | ||
value, | ||
originURL, | ||
@@ -35,5 +38,5 @@ // Optional | ||
for (const part of parts) { | ||
const keyAndValue = part.split('='); | ||
const key = keyAndValue[0].trim().toLowerCase(); | ||
const value = keyAndValue[1]; | ||
const index = part.indexOf('='); | ||
const key = index !== -1 ? part.slice(0, index).trim().toLowerCase() : part.trim().toLowerCase(); | ||
const value = index !== -1 ? part.slice(index + 1).trim() : ''; | ||
switch (key) { | ||
@@ -40,0 +43,0 @@ case 'expires': |
{ | ||
"name": "happy-dom", | ||
"version": "15.10.6", | ||
"version": "15.10.7", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/capricorn86/happy-dom", |
@@ -18,8 +18,11 @@ import CookieSameSiteEnum from '../enums/CookieSameSiteEnum.js'; | ||
const parts = cookieString.split(';'); | ||
const [key, value] = parts.shift().split('='); | ||
const part = parts.shift(); | ||
const index = part.indexOf('='); | ||
const key = index !== -1 ? part.slice(0, index).trim() : part.trim(); | ||
const value = index !== -1 ? part.slice(index + 1).trim() : null; | ||
const cookie: ICookie = { | ||
// Required | ||
key: key.trim(), | ||
value: value ?? null, | ||
key, | ||
value, | ||
originURL, | ||
@@ -42,5 +45,6 @@ | ||
for (const part of parts) { | ||
const keyAndValue = part.split('='); | ||
const key = keyAndValue[0].trim().toLowerCase(); | ||
const value = keyAndValue[1]; | ||
const index = part.indexOf('='); | ||
const key = | ||
index !== -1 ? part.slice(0, index).trim().toLowerCase() : part.trim().toLowerCase(); | ||
const value = index !== -1 ? part.slice(index + 1).trim() : ''; | ||
@@ -47,0 +51,0 @@ switch (key) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12221890
245225