@@ -35404,7 +35404,7 @@ module.exports = {
35404
35404
35405
35405
35406
35406
const { parseSetCookie } = __nccwpck_require__(8915)
35407
- const { stringify, getHeadersList } = __nccwpck_require__(3834)
35407
+ const { stringify } = __nccwpck_require__(3834)
35408
35408
const { webidl } = __nccwpck_require__(4222)
35409
35409
const { Headers } = __nccwpck_require__(6349)
35410
35410
@@ -35480,14 +35480,13 @@ function getSetCookies (headers) {
35480
35480
35481
35481
webidl.brandCheck(headers, Headers, { strict: false })
35482
35482
35483
- const cookies = getHeadersList( headers).cookies
35483
+ const cookies = headers.getSetCookie()
35484
35484
35485
35485
if (!cookies) {
35486
35486
return []
35487
35487
}
35488
35488
35489
- // In older versions of undici, cookies is a list of name:value.
35490
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
35489
+ return cookies.map((pair) => parseSetCookie(pair))
35491
35490
}
35492
35491
35493
35492
/**
@@ -35915,14 +35914,15 @@ module.exports = {
35915
35914
/***/ }),
35916
35915
35917
35916
/***/ 3834:
35918
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
35917
+ /***/ ((module) => {
35919
35918
35920
35919
"use strict";
35921
35920
35922
35921
35923
- const assert = __nccwpck_require__(2613)
35924
- const { kHeadersList } = __nccwpck_require__(6443)
35925
-
35922
+ /**
35923
+ * @param {string} value
35924
+ * @returns {boolean}
35925
+ */
35926
35926
function isCTLExcludingHtab (value) {
35927
35927
if (value.length === 0) {
35928
35928
return false
@@ -36183,31 +36183,13 @@ function stringify (cookie) {
36183
36183
return out.join('; ')
36184
36184
}
36185
36185
36186
- let kHeadersListNode
36187
-
36188
- function getHeadersList (headers) {
36189
- if (headers[kHeadersList]) {
36190
- return headers[kHeadersList]
36191
- }
36192
-
36193
- if (!kHeadersListNode) {
36194
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
36195
- (symbol) => symbol.description === 'headers list'
36196
- )
36197
-
36198
- assert(kHeadersListNode, 'Headers cannot be parsed')
36199
- }
36200
-
36201
- const headersList = headers[kHeadersListNode]
36202
- assert(headersList)
36203
-
36204
- return headersList
36205
- }
36206
-
36207
36186
module.exports = {
36208
36187
isCTLExcludingHtab,
36209
- stringify,
36210
- getHeadersList
36188
+ validateCookieName,
36189
+ validateCookiePath,
36190
+ validateCookieValue,
36191
+ toIMFDate,
36192
+ stringify
36211
36193
}
36212
36194
36213
36195
@@ -40211,6 +40193,7 @@ const {
40211
40193
isValidHeaderName,
40212
40194
isValidHeaderValue
40213
40195
} = __nccwpck_require__(5523)
40196
+ const util = __nccwpck_require__(9023)
40214
40197
const { webidl } = __nccwpck_require__(4222)
40215
40198
const assert = __nccwpck_require__(2613)
40216
40199
@@ -40764,6 +40747,9 @@ Object.defineProperties(Headers.prototype, {
40764
40747
[Symbol.toStringTag]: {
40765
40748
value: 'Headers',
40766
40749
configurable: true
40750
+ },
40751
+ [util.inspect.custom]: {
40752
+ enumerable: false
40767
40753
}
40768
40754
})
40769
40755
@@ -49940,6 +49926,20 @@ class Pool extends PoolBase {
49940
49926
? { ...options.interceptors }
49941
49927
: undefined
49942
49928
this[kFactory] = factory
49929
+
49930
+ this.on('connectionError', (origin, targets, error) => {
49931
+ // If a connection error occurs, we remove the client from the pool,
49932
+ // and emit a connectionError event. They will not be re-used.
49933
+ // Fixes https://github.com/nodejs/undici/issues/3895
49934
+ for (const target of targets) {
49935
+ // Do not use kRemoveClient here, as it will close the client,
49936
+ // but the client cannot be closed in this state.
49937
+ const idx = this[kClients].indexOf(target)
49938
+ if (idx !== -1) {
49939
+ this[kClients].splice(idx, 1)
49940
+ }
49941
+ }
49942
+ })
49943
49943
}
49944
49944
49945
49945
[kGetDispatcher] () {
0 commit comments