@@ -12879,7 +12879,7 @@ module.exports = {
12879
12879
12880
12880
12881
12881
const { parseSetCookie } = __nccwpck_require__(4408)
12882
- const { stringify, getHeadersList } = __nccwpck_require__(3121)
12882
+ const { stringify } = __nccwpck_require__(3121)
12883
12883
const { webidl } = __nccwpck_require__(1744)
12884
12884
const { Headers } = __nccwpck_require__(554)
12885
12885
@@ -12955,14 +12955,13 @@ function getSetCookies (headers) {
12955
12955
12956
12956
webidl.brandCheck(headers, Headers, { strict: false })
12957
12957
12958
- const cookies = getHeadersList( headers).cookies
12958
+ const cookies = headers.getSetCookie()
12959
12959
12960
12960
if (!cookies) {
12961
12961
return []
12962
12962
}
12963
12963
12964
- // In older versions of undici, cookies is a list of name:value.
12965
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
12964
+ return cookies.map((pair) => parseSetCookie(pair))
12966
12965
}
12967
12966
12968
12967
/**
@@ -13390,14 +13389,15 @@ module.exports = {
13390
13389
/***/ }),
13391
13390
13392
13391
/***/ 3121:
13393
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
13392
+ /***/ ((module) => {
13394
13393
13395
13394
"use strict";
13396
13395
13397
13396
13398
- const assert = __nccwpck_require__(9491)
13399
- const { kHeadersList } = __nccwpck_require__(2785)
13400
-
13397
+ /**
13398
+ * @param {string} value
13399
+ * @returns {boolean}
13400
+ */
13401
13401
function isCTLExcludingHtab (value) {
13402
13402
if (value.length === 0) {
13403
13403
return false
@@ -13658,31 +13658,13 @@ function stringify (cookie) {
13658
13658
return out.join('; ')
13659
13659
}
13660
13660
13661
- let kHeadersListNode
13662
-
13663
- function getHeadersList (headers) {
13664
- if (headers[kHeadersList]) {
13665
- return headers[kHeadersList]
13666
- }
13667
-
13668
- if (!kHeadersListNode) {
13669
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
13670
- (symbol) => symbol.description === 'headers list'
13671
- )
13672
-
13673
- assert(kHeadersListNode, 'Headers cannot be parsed')
13674
- }
13675
-
13676
- const headersList = headers[kHeadersListNode]
13677
- assert(headersList)
13678
-
13679
- return headersList
13680
- }
13681
-
13682
13661
module.exports = {
13683
13662
isCTLExcludingHtab,
13684
- stringify,
13685
- getHeadersList
13663
+ validateCookieName,
13664
+ validateCookiePath,
13665
+ validateCookieValue,
13666
+ toIMFDate,
13667
+ stringify
13686
13668
}
13687
13669
13688
13670
@@ -17686,6 +17668,7 @@ const {
17686
17668
isValidHeaderName,
17687
17669
isValidHeaderValue
17688
17670
} = __nccwpck_require__(2538)
17671
+ const util = __nccwpck_require__(3837)
17689
17672
const { webidl } = __nccwpck_require__(1744)
17690
17673
const assert = __nccwpck_require__(9491)
17691
17674
@@ -18239,6 +18222,9 @@ Object.defineProperties(Headers.prototype, {
18239
18222
[Symbol.toStringTag]: {
18240
18223
value: 'Headers',
18241
18224
configurable: true
18225
+ },
18226
+ [util.inspect.custom]: {
18227
+ enumerable: false
18242
18228
}
18243
18229
})
18244
18230
@@ -27415,6 +27401,20 @@ class Pool extends PoolBase {
27415
27401
? { ...options.interceptors }
27416
27402
: undefined
27417
27403
this[kFactory] = factory
27404
+
27405
+ this.on('connectionError', (origin, targets, error) => {
27406
+ // If a connection error occurs, we remove the client from the pool,
27407
+ // and emit a connectionError event. They will not be re-used.
27408
+ // Fixes https://github.com/nodejs/undici/issues/3895
27409
+ for (const target of targets) {
27410
+ // Do not use kRemoveClient here, as it will close the client,
27411
+ // but the client cannot be closed in this state.
27412
+ const idx = this[kClients].indexOf(target)
27413
+ if (idx !== -1) {
27414
+ this[kClients].splice(idx, 1)
27415
+ }
27416
+ }
27417
+ })
27418
27418
}
27419
27419
27420
27420
[kGetDispatcher] () {
0 commit comments