@@ -92160,7 +92160,7 @@ module.exports = {
92160
92160
92161
92161
92162
92162
const { parseSetCookie } = __nccwpck_require__(8915)
92163
- const { stringify, getHeadersList } = __nccwpck_require__(3834)
92163
+ const { stringify } = __nccwpck_require__(3834)
92164
92164
const { webidl } = __nccwpck_require__(74222)
92165
92165
const { Headers } = __nccwpck_require__(26349)
92166
92166
@@ -92236,14 +92236,13 @@ function getSetCookies (headers) {
92236
92236
92237
92237
webidl.brandCheck(headers, Headers, { strict: false })
92238
92238
92239
- const cookies = getHeadersList( headers).cookies
92239
+ const cookies = headers.getSetCookie()
92240
92240
92241
92241
if (!cookies) {
92242
92242
return []
92243
92243
}
92244
92244
92245
- // In older versions of undici, cookies is a list of name:value.
92246
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
92245
+ return cookies.map((pair) => parseSetCookie(pair))
92247
92246
}
92248
92247
92249
92248
/**
@@ -92671,14 +92670,15 @@ module.exports = {
92671
92670
/***/ }),
92672
92671
92673
92672
/***/ 3834:
92674
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
92673
+ /***/ ((module) => {
92675
92674
92676
92675
"use strict";
92677
92676
92678
92677
92679
- const assert = __nccwpck_require__(42613)
92680
- const { kHeadersList } = __nccwpck_require__(36443)
92681
-
92678
+ /**
92679
+ * @param {string} value
92680
+ * @returns {boolean}
92681
+ */
92682
92682
function isCTLExcludingHtab (value) {
92683
92683
if (value.length === 0) {
92684
92684
return false
@@ -92939,31 +92939,13 @@ function stringify (cookie) {
92939
92939
return out.join('; ')
92940
92940
}
92941
92941
92942
- let kHeadersListNode
92943
-
92944
- function getHeadersList (headers) {
92945
- if (headers[kHeadersList]) {
92946
- return headers[kHeadersList]
92947
- }
92948
-
92949
- if (!kHeadersListNode) {
92950
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
92951
- (symbol) => symbol.description === 'headers list'
92952
- )
92953
-
92954
- assert(kHeadersListNode, 'Headers cannot be parsed')
92955
- }
92956
-
92957
- const headersList = headers[kHeadersListNode]
92958
- assert(headersList)
92959
-
92960
- return headersList
92961
- }
92962
-
92963
92942
module.exports = {
92964
92943
isCTLExcludingHtab,
92965
- stringify,
92966
- getHeadersList
92944
+ validateCookieName,
92945
+ validateCookiePath,
92946
+ validateCookieValue,
92947
+ toIMFDate,
92948
+ stringify
92967
92949
}
92968
92950
92969
92951
@@ -96967,6 +96949,7 @@ const {
96967
96949
isValidHeaderName,
96968
96950
isValidHeaderValue
96969
96951
} = __nccwpck_require__(15523)
96952
+ const util = __nccwpck_require__(39023)
96970
96953
const { webidl } = __nccwpck_require__(74222)
96971
96954
const assert = __nccwpck_require__(42613)
96972
96955
@@ -97520,6 +97503,9 @@ Object.defineProperties(Headers.prototype, {
97520
97503
[Symbol.toStringTag]: {
97521
97504
value: 'Headers',
97522
97505
configurable: true
97506
+ },
97507
+ [util.inspect.custom]: {
97508
+ enumerable: false
97523
97509
}
97524
97510
})
97525
97511
@@ -106696,6 +106682,20 @@ class Pool extends PoolBase {
106696
106682
? { ...options.interceptors }
106697
106683
: undefined
106698
106684
this[kFactory] = factory
106685
+
106686
+ this.on('connectionError', (origin, targets, error) => {
106687
+ // If a connection error occurs, we remove the client from the pool,
106688
+ // and emit a connectionError event. They will not be re-used.
106689
+ // Fixes https://github.com/nodejs/undici/issues/3895
106690
+ for (const target of targets) {
106691
+ // Do not use kRemoveClient here, as it will close the client,
106692
+ // but the client cannot be closed in this state.
106693
+ const idx = this[kClients].indexOf(target)
106694
+ if (idx !== -1) {
106695
+ this[kClients].splice(idx, 1)
106696
+ }
106697
+ }
106698
+ })
106699
106699
}
106700
106700
106701
106701
[kGetDispatcher] () {
0 commit comments