@@ -15806,7 +15806,7 @@ module.exports = {
15806
15806
15807
15807
15808
15808
const { parseSetCookie } = __nccwpck_require__(8915)
15809
- const { stringify, getHeadersList } = __nccwpck_require__(3834)
15809
+ const { stringify } = __nccwpck_require__(3834)
15810
15810
const { webidl } = __nccwpck_require__(4222)
15811
15811
const { Headers } = __nccwpck_require__(6349)
15812
15812
@@ -15882,14 +15882,13 @@ function getSetCookies (headers) {
15882
15882
15883
15883
webidl.brandCheck(headers, Headers, { strict: false })
15884
15884
15885
- const cookies = getHeadersList( headers).cookies
15885
+ const cookies = headers.getSetCookie()
15886
15886
15887
15887
if (!cookies) {
15888
15888
return []
15889
15889
}
15890
15890
15891
- // In older versions of undici, cookies is a list of name:value.
15892
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
15891
+ return cookies.map((pair) => parseSetCookie(pair))
15893
15892
}
15894
15893
15895
15894
/**
@@ -16317,14 +16316,15 @@ module.exports = {
16317
16316
/***/ }),
16318
16317
16319
16318
/***/ 3834:
16320
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
16319
+ /***/ ((module) => {
16321
16320
16322
16321
"use strict";
16323
16322
16324
16323
16325
- const assert = __nccwpck_require__(2613)
16326
- const { kHeadersList } = __nccwpck_require__(6443)
16327
-
16324
+ /**
16325
+ * @param {string} value
16326
+ * @returns {boolean}
16327
+ */
16328
16328
function isCTLExcludingHtab (value) {
16329
16329
if (value.length === 0) {
16330
16330
return false
@@ -16585,31 +16585,13 @@ function stringify (cookie) {
16585
16585
return out.join('; ')
16586
16586
}
16587
16587
16588
- let kHeadersListNode
16589
-
16590
- function getHeadersList (headers) {
16591
- if (headers[kHeadersList]) {
16592
- return headers[kHeadersList]
16593
- }
16594
-
16595
- if (!kHeadersListNode) {
16596
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
16597
- (symbol) => symbol.description === 'headers list'
16598
- )
16599
-
16600
- assert(kHeadersListNode, 'Headers cannot be parsed')
16601
- }
16602
-
16603
- const headersList = headers[kHeadersListNode]
16604
- assert(headersList)
16605
-
16606
- return headersList
16607
- }
16608
-
16609
16588
module.exports = {
16610
16589
isCTLExcludingHtab,
16611
- stringify,
16612
- getHeadersList
16590
+ validateCookieName,
16591
+ validateCookiePath,
16592
+ validateCookieValue,
16593
+ toIMFDate,
16594
+ stringify
16613
16595
}
16614
16596
16615
16597
@@ -20613,6 +20595,7 @@ const {
20613
20595
isValidHeaderName,
20614
20596
isValidHeaderValue
20615
20597
} = __nccwpck_require__(5523)
20598
+ const util = __nccwpck_require__(9023)
20616
20599
const { webidl } = __nccwpck_require__(4222)
20617
20600
const assert = __nccwpck_require__(2613)
20618
20601
@@ -21166,6 +21149,9 @@ Object.defineProperties(Headers.prototype, {
21166
21149
[Symbol.toStringTag]: {
21167
21150
value: 'Headers',
21168
21151
configurable: true
21152
+ },
21153
+ [util.inspect.custom]: {
21154
+ enumerable: false
21169
21155
}
21170
21156
})
21171
21157
@@ -30342,6 +30328,20 @@ class Pool extends PoolBase {
30342
30328
? { ...options.interceptors }
30343
30329
: undefined
30344
30330
this[kFactory] = factory
30331
+
30332
+ this.on('connectionError', (origin, targets, error) => {
30333
+ // If a connection error occurs, we remove the client from the pool,
30334
+ // and emit a connectionError event. They will not be re-used.
30335
+ // Fixes https://github.com/nodejs/undici/issues/3895
30336
+ for (const target of targets) {
30337
+ // Do not use kRemoveClient here, as it will close the client,
30338
+ // but the client cannot be closed in this state.
30339
+ const idx = this[kClients].indexOf(target)
30340
+ if (idx !== -1) {
30341
+ this[kClients].splice(idx, 1)
30342
+ }
30343
+ }
30344
+ })
30345
30345
}
30346
30346
30347
30347
[kGetDispatcher] () {
0 commit comments