aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/undici/lib/web/cookies/parse.js
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-21 07:49:34 +0200
committerEgor Tensin <egor@tensin.name>2026-06-21 07:49:34 +0200
commit3421d2ed73f43159e8fa04943e13ca9c0f0404d3 (patch)
tree5302ee9ac0ea902e85ec8f600b4f58984576e02b /node_modules/undici/lib/web/cookies/parse.js
parentMerge pull request #10 from egor-tensin/dependabot/github_actions/actions/che... (diff)
downloadcleanup-path-3421d2ed73f43159e8fa04943e13ca9c0f0404d3.tar.gz
cleanup-path-3421d2ed73f43159e8fa04943e13ca9c0f0404d3.zip
bump dependencies
Diffstat (limited to 'node_modules/undici/lib/web/cookies/parse.js')
-rw-r--r--node_modules/undici/lib/web/cookies/parse.js39
1 files changed, 16 insertions, 23 deletions
diff --git a/node_modules/undici/lib/web/cookies/parse.js b/node_modules/undici/lib/web/cookies/parse.js
index 3c48c26..b3c25fb 100644
--- a/node_modules/undici/lib/web/cookies/parse.js
+++ b/node_modules/undici/lib/web/cookies/parse.js
@@ -275,32 +275,25 @@ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {})
// If the attribute-name case-insensitively matches the string
// "SameSite", the user agent MUST process the cookie-av as follows:
- // 1. Let enforcement be "Default".
- let enforcement = 'Default'
-
const attributeValueLowercase = attributeValue.toLowerCase()
- // 2. If cookie-av's attribute-value is a case-insensitive match for
- // "None", set enforcement to "None".
- if (attributeValueLowercase.includes('none')) {
- enforcement = 'None'
- }
- // 3. If cookie-av's attribute-value is a case-insensitive match for
- // "Strict", set enforcement to "Strict".
- if (attributeValueLowercase.includes('strict')) {
- enforcement = 'Strict'
+ // 1. If cookie-av's attribute-value is a case-insensitive match for
+ // "None", append an attribute to the cookie-attribute-list with an
+ // attribute-name of "SameSite" and an attribute-value of "None".
+ if (attributeValueLowercase === 'none') {
+ cookieAttributeList.sameSite = 'None'
+ } else if (attributeValueLowercase === 'strict') {
+ // 2. If cookie-av's attribute-value is a case-insensitive match for
+ // "Strict", append an attribute to the cookie-attribute-list with
+ // an attribute-name of "SameSite" and an attribute-value of
+ // "Strict".
+ cookieAttributeList.sameSite = 'Strict'
+ } else if (attributeValueLowercase === 'lax') {
+ // 3. If cookie-av's attribute-value is a case-insensitive match for
+ // "Lax", append an attribute to the cookie-attribute-list with an
+ // attribute-name of "SameSite" and an attribute-value of "Lax".
+ cookieAttributeList.sameSite = 'Lax'
}
-
- // 4. If cookie-av's attribute-value is a case-insensitive match for
- // "Lax", set enforcement to "Lax".
- if (attributeValueLowercase.includes('lax')) {
- enforcement = 'Lax'
- }
-
- // 5. Append an attribute to the cookie-attribute-list with an
- // attribute-name of "SameSite" and an attribute-value of
- // enforcement.
- cookieAttributeList.sameSite = enforcement
} else {
cookieAttributeList.unparsed ??= []