@@ -16685,7 +16685,7 @@ module.exports = {
16685
16685
16686
16686
16687
16687
const { parseSetCookie } = __nccwpck_require__(8915)
16688
- const { stringify, getHeadersList } = __nccwpck_require__(3834)
16688
+ const { stringify } = __nccwpck_require__(3834)
16689
16689
const { webidl } = __nccwpck_require__(4222)
16690
16690
const { Headers } = __nccwpck_require__(6349)
16691
16691
@@ -16761,14 +16761,13 @@ function getSetCookies (headers) {
16761
16761
16762
16762
webidl.brandCheck(headers, Headers, { strict: false })
16763
16763
16764
- const cookies = getHeadersList( headers).cookies
16764
+ const cookies = headers.getSetCookie()
16765
16765
16766
16766
if (!cookies) {
16767
16767
return []
16768
16768
}
16769
16769
16770
- // In older versions of undici, cookies is a list of name:value.
16771
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
16770
+ return cookies.map((pair) => parseSetCookie(pair))
16772
16771
}
16773
16772
16774
16773
/**
@@ -17196,14 +17195,15 @@ module.exports = {
17196
17195
/***/ }),
17197
17196
17198
17197
/***/ 3834:
17199
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
17198
+ /***/ ((module) => {
17200
17199
17201
17200
"use strict";
17202
17201
17203
17202
17204
- const assert = __nccwpck_require__(2613)
17205
- const { kHeadersList } = __nccwpck_require__(6443)
17206
-
17203
+ /**
17204
+ * @param {string} value
17205
+ * @returns {boolean}
17206
+ */
17207
17207
function isCTLExcludingHtab (value) {
17208
17208
if (value.length === 0) {
17209
17209
return false
@@ -17464,31 +17464,13 @@ function stringify (cookie) {
17464
17464
return out.join('; ')
17465
17465
}
17466
17466
17467
- let kHeadersListNode
17468
-
17469
- function getHeadersList (headers) {
17470
- if (headers[kHeadersList]) {
17471
- return headers[kHeadersList]
17472
- }
17473
-
17474
- if (!kHeadersListNode) {
17475
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
17476
- (symbol) => symbol.description === 'headers list'
17477
- )
17478
-
17479
- assert(kHeadersListNode, 'Headers cannot be parsed')
17480
- }
17481
-
17482
- const headersList = headers[kHeadersListNode]
17483
- assert(headersList)
17484
-
17485
- return headersList
17486
- }
17487
-
17488
17467
module.exports = {
17489
17468
isCTLExcludingHtab,
17490
- stringify,
17491
- getHeadersList
17469
+ validateCookieName,
17470
+ validateCookiePath,
17471
+ validateCookieValue,
17472
+ toIMFDate,
17473
+ stringify
17492
17474
}
17493
17475
17494
17476
@@ -21492,6 +21474,7 @@ const {
21492
21474
isValidHeaderName,
21493
21475
isValidHeaderValue
21494
21476
} = __nccwpck_require__(5523)
21477
+ const util = __nccwpck_require__(9023)
21495
21478
const { webidl } = __nccwpck_require__(4222)
21496
21479
const assert = __nccwpck_require__(2613)
21497
21480
@@ -22045,6 +22028,9 @@ Object.defineProperties(Headers.prototype, {
22045
22028
[Symbol.toStringTag]: {
22046
22029
value: 'Headers',
22047
22030
configurable: true
22031
+ },
22032
+ [util.inspect.custom]: {
22033
+ enumerable: false
22048
22034
}
22049
22035
})
22050
22036
@@ -31221,6 +31207,20 @@ class Pool extends PoolBase {
31221
31207
? { ...options.interceptors }
31222
31208
: undefined
31223
31209
this[kFactory] = factory
31210
+
31211
+ this.on('connectionError', (origin, targets, error) => {
31212
+ // If a connection error occurs, we remove the client from the pool,
31213
+ // and emit a connectionError event. They will not be re-used.
31214
+ // Fixes https://github.com/nodejs/undici/issues/3895
31215
+ for (const target of targets) {
31216
+ // Do not use kRemoveClient here, as it will close the client,
31217
+ // but the client cannot be closed in this state.
31218
+ const idx = this[kClients].indexOf(target)
31219
+ if (idx !== -1) {
31220
+ this[kClients].splice(idx, 1)
31221
+ }
31222
+ }
31223
+ })
31224
31224
}
31225
31225
31226
31226
[kGetDispatcher] () {
0 commit comments