@@ -275,32 +275,25 @@ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) |
275 | 275 | // If the attribute-name case-insensitively matches the string |
276 | 276 | // "SameSite", the user agent MUST process the cookie-av as follows: |
277 | 277 |
|
278 | | - // 1. Let enforcement be "Default". |
279 | | - let enforcement = 'Default' |
280 | | - |
281 | 278 | const attributeValueLowercase = attributeValue.toLowerCase() |
282 | | - // 2. If cookie-av's attribute-value is a case-insensitive match for |
283 | | - // "None", set enforcement to "None". |
284 | | - if (attributeValueLowercase.includes('none')) { |
285 | | - enforcement = 'None' |
286 | | - } |
287 | 279 |
|
288 | | - // 3. If cookie-av's attribute-value is a case-insensitive match for |
289 | | - // "Strict", set enforcement to "Strict". |
290 | | - if (attributeValueLowercase.includes('strict')) { |
291 | | - enforcement = 'Strict' |
| 280 | + // 1. If cookie-av's attribute-value is a case-insensitive match for |
| 281 | + // "None", append an attribute to the cookie-attribute-list with an |
| 282 | + // attribute-name of "SameSite" and an attribute-value of "None". |
| 283 | + if (attributeValueLowercase === 'none') { |
| 284 | + cookieAttributeList.sameSite = 'None' |
| 285 | + } else if (attributeValueLowercase === 'strict') { |
| 286 | + // 2. If cookie-av's attribute-value is a case-insensitive match for |
| 287 | + // "Strict", append an attribute to the cookie-attribute-list with |
| 288 | + // an attribute-name of "SameSite" and an attribute-value of |
| 289 | + // "Strict". |
| 290 | + cookieAttributeList.sameSite = 'Strict' |
| 291 | + } else if (attributeValueLowercase === 'lax') { |
| 292 | + // 3. If cookie-av's attribute-value is a case-insensitive match for |
| 293 | + // "Lax", append an attribute to the cookie-attribute-list with an |
| 294 | + // attribute-name of "SameSite" and an attribute-value of "Lax". |
| 295 | + cookieAttributeList.sameSite = 'Lax' |
292 | 296 | } |
293 | | - |
294 | | - // 4. If cookie-av's attribute-value is a case-insensitive match for |
295 | | - // "Lax", set enforcement to "Lax". |
296 | | - if (attributeValueLowercase.includes('lax')) { |
297 | | - enforcement = 'Lax' |
298 | | - } |
299 | | - |
300 | | - // 5. Append an attribute to the cookie-attribute-list with an |
301 | | - // attribute-name of "SameSite" and an attribute-value of |
302 | | - // enforcement. |
303 | | - cookieAttributeList.sameSite = enforcement |
304 | 297 | } else { |
305 | 298 | cookieAttributeList.unparsed ??= [] |
306 | 299 |
|
|