aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/undici/lib/cookies
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2025-12-16 16:51:48 +0100
committerEgor Tensin <egor@tensin.name>2025-12-16 16:51:54 +0100
commit342fb8ba128c1fbbf5195a7b5d56cb5b8f8fdca9 (patch)
tree1af9b90985a2685c70e8e756eabc62a21ca362bb /node_modules/undici/lib/cookies
parentbump dependencies (diff)
downloadcleanup-path-342fb8ba128c1fbbf5195a7b5d56cb5b8f8fdca9.tar.gz
cleanup-path-342fb8ba128c1fbbf5195a7b5d56cb5b8f8fdca9.zip
bump dependencies
Diffstat (limited to 'node_modules/undici/lib/cookies')
-rw-r--r--node_modules/undici/lib/cookies/index.js7
-rw-r--r--node_modules/undici/lib/cookies/util.js35
2 files changed, 12 insertions, 30 deletions
diff --git a/node_modules/undici/lib/cookies/index.js b/node_modules/undici/lib/cookies/index.js
index c9c1f28..f867b19 100644
--- a/node_modules/undici/lib/cookies/index.js
+++ b/node_modules/undici/lib/cookies/index.js
@@ -1,7 +1,7 @@
'use strict'
const { parseSetCookie } = require('./parse')
-const { stringify, getHeadersList } = require('./util')
+const { stringify } = require('./util')
const { webidl } = require('../fetch/webidl')
const { Headers } = require('../fetch/headers')
@@ -77,14 +77,13 @@ function getSetCookies (headers) {
webidl.brandCheck(headers, Headers, { strict: false })
- const cookies = getHeadersList(headers).cookies
+ const cookies = headers.getSetCookie()
if (!cookies) {
return []
}
- // In older versions of undici, cookies is a list of name:value.
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
+ return cookies.map((pair) => parseSetCookie(pair))
}
/**
diff --git a/node_modules/undici/lib/cookies/util.js b/node_modules/undici/lib/cookies/util.js
index 2290329..be3ccbe 100644
--- a/node_modules/undici/lib/cookies/util.js
+++ b/node_modules/undici/lib/cookies/util.js
@@ -1,8 +1,9 @@
'use strict'
-const assert = require('assert')
-const { kHeadersList } = require('../core/symbols')
-
+/**
+ * @param {string} value
+ * @returns {boolean}
+ */
function isCTLExcludingHtab (value) {
if (value.length === 0) {
return false
@@ -263,29 +264,11 @@ function stringify (cookie) {
return out.join('; ')
}
-let kHeadersListNode
-
-function getHeadersList (headers) {
- if (headers[kHeadersList]) {
- return headers[kHeadersList]
- }
-
- if (!kHeadersListNode) {
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
- (symbol) => symbol.description === 'headers list'
- )
-
- assert(kHeadersListNode, 'Headers cannot be parsed')
- }
-
- const headersList = headers[kHeadersListNode]
- assert(headersList)
-
- return headersList
-}
-
module.exports = {
isCTLExcludingHtab,
- stringify,
- getHeadersList
+ validateCookieName,
+ validateCookiePath,
+ validateCookieValue,
+ toIMFDate,
+ stringify
}