@@ -11120,7 +11120,7 @@ module.exports = {
11120
11120
11121
11121
11122
11122
const { parseSetCookie } = __nccwpck_require__(4408)
11123
- const { stringify, getHeadersList } = __nccwpck_require__(3121)
11123
+ const { stringify } = __nccwpck_require__(3121)
11124
11124
const { webidl } = __nccwpck_require__(1744)
11125
11125
const { Headers } = __nccwpck_require__(554)
11126
11126
@@ -11196,14 +11196,13 @@ function getSetCookies (headers) {
11196
11196
11197
11197
webidl.brandCheck(headers, Headers, { strict: false })
11198
11198
11199
- const cookies = getHeadersList( headers).cookies
11199
+ const cookies = headers.getSetCookie()
11200
11200
11201
11201
if (!cookies) {
11202
11202
return []
11203
11203
}
11204
11204
11205
- // In older versions of undici, cookies is a list of name:value.
11206
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
11205
+ return cookies.map((pair) => parseSetCookie(pair))
11207
11206
}
11208
11207
11209
11208
/**
@@ -11631,14 +11630,15 @@ module.exports = {
11631
11630
/***/ }),
11632
11631
11633
11632
/***/ 3121:
11634
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
11633
+ /***/ ((module) => {
11635
11634
11636
11635
"use strict";
11637
11636
11638
11637
11639
- const assert = __nccwpck_require__(9491)
11640
- const { kHeadersList } = __nccwpck_require__(2785)
11641
-
11638
+ /**
11639
+ * @param {string} value
11640
+ * @returns {boolean}
11641
+ */
11642
11642
function isCTLExcludingHtab (value) {
11643
11643
if (value.length === 0) {
11644
11644
return false
@@ -11899,31 +11899,13 @@ function stringify (cookie) {
11899
11899
return out.join('; ')
11900
11900
}
11901
11901
11902
- let kHeadersListNode
11903
-
11904
- function getHeadersList (headers) {
11905
- if (headers[kHeadersList]) {
11906
- return headers[kHeadersList]
11907
- }
11908
-
11909
- if (!kHeadersListNode) {
11910
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
11911
- (symbol) => symbol.description === 'headers list'
11912
- )
11913
-
11914
- assert(kHeadersListNode, 'Headers cannot be parsed')
11915
- }
11916
-
11917
- const headersList = headers[kHeadersListNode]
11918
- assert(headersList)
11919
-
11920
- return headersList
11921
- }
11922
-
11923
11902
module.exports = {
11924
11903
isCTLExcludingHtab,
11925
- stringify,
11926
- getHeadersList
11904
+ validateCookieName,
11905
+ validateCookiePath,
11906
+ validateCookieValue,
11907
+ toIMFDate,
11908
+ stringify
11927
11909
}
11928
11910
11929
11911
@@ -15927,6 +15909,7 @@ const {
15927
15909
isValidHeaderName,
15928
15910
isValidHeaderValue
15929
15911
} = __nccwpck_require__(2538)
15912
+ const util = __nccwpck_require__(3837)
15930
15913
const { webidl } = __nccwpck_require__(1744)
15931
15914
const assert = __nccwpck_require__(9491)
15932
15915
@@ -16480,6 +16463,9 @@ Object.defineProperties(Headers.prototype, {
16480
16463
[Symbol.toStringTag]: {
16481
16464
value: 'Headers',
16482
16465
configurable: true
16466
+ },
16467
+ [util.inspect.custom]: {
16468
+ enumerable: false
16483
16469
}
16484
16470
})
16485
16471
@@ -25656,6 +25642,20 @@ class Pool extends PoolBase {
25656
25642
? { ...options.interceptors }
25657
25643
: undefined
25658
25644
this[kFactory] = factory
25645
+
25646
+ this.on('connectionError', (origin, targets, error) => {
25647
+ // If a connection error occurs, we remove the client from the pool,
25648
+ // and emit a connectionError event. They will not be re-used.
25649
+ // Fixes https://github.com/nodejs/undici/issues/3895
25650
+ for (const target of targets) {
25651
+ // Do not use kRemoveClient here, as it will close the client,
25652
+ // but the client cannot be closed in this state.
25653
+ const idx = this[kClients].indexOf(target)
25654
+ if (idx !== -1) {
25655
+ this[kClients].splice(idx, 1)
25656
+ }
25657
+ }
25658
+ })
25659
25659
}
25660
25660
25661
25661
[kGetDispatcher] () {
0 commit comments