@@ -13821,7 +13821,7 @@ module.exports = {
13821
13821
13822
13822
13823
13823
const { parseSetCookie } = __nccwpck_require__(4408)
13824
- const { stringify, getHeadersList } = __nccwpck_require__(3121)
13824
+ const { stringify } = __nccwpck_require__(3121)
13825
13825
const { webidl } = __nccwpck_require__(1744)
13826
13826
const { Headers } = __nccwpck_require__(554)
13827
13827
@@ -13897,14 +13897,13 @@ function getSetCookies (headers) {
13897
13897
13898
13898
webidl.brandCheck(headers, Headers, { strict: false })
13899
13899
13900
- const cookies = getHeadersList( headers).cookies
13900
+ const cookies = headers.getSetCookie()
13901
13901
13902
13902
if (!cookies) {
13903
13903
return []
13904
13904
}
13905
13905
13906
- // In older versions of undici, cookies is a list of name:value.
13907
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
13906
+ return cookies.map((pair) => parseSetCookie(pair))
13908
13907
}
13909
13908
13910
13909
/**
@@ -14332,14 +14331,15 @@ module.exports = {
14332
14331
/***/ }),
14333
14332
14334
14333
/***/ 3121:
14335
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
14334
+ /***/ ((module) => {
14336
14335
14337
14336
"use strict";
14338
14337
14339
14338
14340
- const assert = __nccwpck_require__(9491)
14341
- const { kHeadersList } = __nccwpck_require__(2785)
14342
-
14339
+ /**
14340
+ * @param {string} value
14341
+ * @returns {boolean}
14342
+ */
14343
14343
function isCTLExcludingHtab (value) {
14344
14344
if (value.length === 0) {
14345
14345
return false
@@ -14600,31 +14600,13 @@ function stringify (cookie) {
14600
14600
return out.join('; ')
14601
14601
}
14602
14602
14603
- let kHeadersListNode
14604
-
14605
- function getHeadersList (headers) {
14606
- if (headers[kHeadersList]) {
14607
- return headers[kHeadersList]
14608
- }
14609
-
14610
- if (!kHeadersListNode) {
14611
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
14612
- (symbol) => symbol.description === 'headers list'
14613
- )
14614
-
14615
- assert(kHeadersListNode, 'Headers cannot be parsed')
14616
- }
14617
-
14618
- const headersList = headers[kHeadersListNode]
14619
- assert(headersList)
14620
-
14621
- return headersList
14622
- }
14623
-
14624
14603
module.exports = {
14625
14604
isCTLExcludingHtab,
14626
- stringify,
14627
- getHeadersList
14605
+ validateCookieName,
14606
+ validateCookiePath,
14607
+ validateCookieValue,
14608
+ toIMFDate,
14609
+ stringify
14628
14610
}
14629
14611
14630
14612
@@ -18628,6 +18610,7 @@ const {
18628
18610
isValidHeaderName,
18629
18611
isValidHeaderValue
18630
18612
} = __nccwpck_require__(2538)
18613
+ const util = __nccwpck_require__(3837)
18631
18614
const { webidl } = __nccwpck_require__(1744)
18632
18615
const assert = __nccwpck_require__(9491)
18633
18616
@@ -19181,6 +19164,9 @@ Object.defineProperties(Headers.prototype, {
19181
19164
[Symbol.toStringTag]: {
19182
19165
value: 'Headers',
19183
19166
configurable: true
19167
+ },
19168
+ [util.inspect.custom]: {
19169
+ enumerable: false
19184
19170
}
19185
19171
})
19186
19172
@@ -28357,6 +28343,20 @@ class Pool extends PoolBase {
28357
28343
? { ...options.interceptors }
28358
28344
: undefined
28359
28345
this[kFactory] = factory
28346
+
28347
+ this.on('connectionError', (origin, targets, error) => {
28348
+ // If a connection error occurs, we remove the client from the pool,
28349
+ // and emit a connectionError event. They will not be re-used.
28350
+ // Fixes https://github.com/nodejs/undici/issues/3895
28351
+ for (const target of targets) {
28352
+ // Do not use kRemoveClient here, as it will close the client,
28353
+ // but the client cannot be closed in this state.
28354
+ const idx = this[kClients].indexOf(target)
28355
+ if (idx !== -1) {
28356
+ this[kClients].splice(idx, 1)
28357
+ }
28358
+ }
28359
+ })
28360
28360
}
28361
28361
28362
28362
[kGetDispatcher] () {
0 commit comments