@@ -15617,7 +15617,7 @@ module.exports = {
15617
15617
15618
15618
15619
15619
const { parseSetCookie } = __nccwpck_require__(8915)
15620
- const { stringify, getHeadersList } = __nccwpck_require__(3834)
15620
+ const { stringify } = __nccwpck_require__(3834)
15621
15621
const { webidl } = __nccwpck_require__(4222)
15622
15622
const { Headers } = __nccwpck_require__(6349)
15623
15623
@@ -15693,14 +15693,13 @@ function getSetCookies (headers) {
15693
15693
15694
15694
webidl.brandCheck(headers, Headers, { strict: false })
15695
15695
15696
- const cookies = getHeadersList( headers).cookies
15696
+ const cookies = headers.getSetCookie()
15697
15697
15698
15698
if (!cookies) {
15699
15699
return []
15700
15700
}
15701
15701
15702
- // In older versions of undici, cookies is a list of name:value.
15703
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
15702
+ return cookies.map((pair) => parseSetCookie(pair))
15704
15703
}
15705
15704
15706
15705
/**
@@ -16128,14 +16127,15 @@ module.exports = {
16128
16127
/***/ }),
16129
16128
16130
16129
/***/ 3834:
16131
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
16130
+ /***/ ((module) => {
16132
16131
16133
16132
"use strict";
16134
16133
16135
16134
16136
- const assert = __nccwpck_require__(2613)
16137
- const { kHeadersList } = __nccwpck_require__(6443)
16138
-
16135
+ /**
16136
+ * @param {string} value
16137
+ * @returns {boolean}
16138
+ */
16139
16139
function isCTLExcludingHtab (value) {
16140
16140
if (value.length === 0) {
16141
16141
return false
@@ -16396,31 +16396,13 @@ function stringify (cookie) {
16396
16396
return out.join('; ')
16397
16397
}
16398
16398
16399
- let kHeadersListNode
16400
-
16401
- function getHeadersList (headers) {
16402
- if (headers[kHeadersList]) {
16403
- return headers[kHeadersList]
16404
- }
16405
-
16406
- if (!kHeadersListNode) {
16407
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
16408
- (symbol) => symbol.description === 'headers list'
16409
- )
16410
-
16411
- assert(kHeadersListNode, 'Headers cannot be parsed')
16412
- }
16413
-
16414
- const headersList = headers[kHeadersListNode]
16415
- assert(headersList)
16416
-
16417
- return headersList
16418
- }
16419
-
16420
16399
module.exports = {
16421
16400
isCTLExcludingHtab,
16422
- stringify,
16423
- getHeadersList
16401
+ validateCookieName,
16402
+ validateCookiePath,
16403
+ validateCookieValue,
16404
+ toIMFDate,
16405
+ stringify
16424
16406
}
16425
16407
16426
16408
@@ -20424,6 +20406,7 @@ const {
20424
20406
isValidHeaderName,
20425
20407
isValidHeaderValue
20426
20408
} = __nccwpck_require__(5523)
20409
+ const util = __nccwpck_require__(9023)
20427
20410
const { webidl } = __nccwpck_require__(4222)
20428
20411
const assert = __nccwpck_require__(2613)
20429
20412
@@ -20977,6 +20960,9 @@ Object.defineProperties(Headers.prototype, {
20977
20960
[Symbol.toStringTag]: {
20978
20961
value: 'Headers',
20979
20962
configurable: true
20963
+ },
20964
+ [util.inspect.custom]: {
20965
+ enumerable: false
20980
20966
}
20981
20967
})
20982
20968
@@ -30153,6 +30139,20 @@ class Pool extends PoolBase {
30153
30139
? { ...options.interceptors }
30154
30140
: undefined
30155
30141
this[kFactory] = factory
30142
+
30143
+ this.on('connectionError', (origin, targets, error) => {
30144
+ // If a connection error occurs, we remove the client from the pool,
30145
+ // and emit a connectionError event. They will not be re-used.
30146
+ // Fixes https://github.com/nodejs/undici/issues/3895
30147
+ for (const target of targets) {
30148
+ // Do not use kRemoveClient here, as it will close the client,
30149
+ // but the client cannot be closed in this state.
30150
+ const idx = this[kClients].indexOf(target)
30151
+ if (idx !== -1) {
30152
+ this[kClients].splice(idx, 1)
30153
+ }
30154
+ }
30155
+ })
30156
30156
}
30157
30157
30158
30158
[kGetDispatcher] () {
0 commit comments