@@ -13094,7 +13094,7 @@ module.exports = {
13094
13094
13095
13095
13096
13096
const { parseSetCookie } = __nccwpck_require__(8915)
13097
- const { stringify, getHeadersList } = __nccwpck_require__(3834)
13097
+ const { stringify } = __nccwpck_require__(3834)
13098
13098
const { webidl } = __nccwpck_require__(4222)
13099
13099
const { Headers } = __nccwpck_require__(6349)
13100
13100
@@ -13170,14 +13170,13 @@ function getSetCookies (headers) {
13170
13170
13171
13171
webidl.brandCheck(headers, Headers, { strict: false })
13172
13172
13173
- const cookies = getHeadersList( headers).cookies
13173
+ const cookies = headers.getSetCookie()
13174
13174
13175
13175
if (!cookies) {
13176
13176
return []
13177
13177
}
13178
13178
13179
- // In older versions of undici, cookies is a list of name:value.
13180
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
13179
+ return cookies.map((pair) => parseSetCookie(pair))
13181
13180
}
13182
13181
13183
13182
/**
@@ -13605,14 +13604,15 @@ module.exports = {
13605
13604
/***/ }),
13606
13605
13607
13606
/***/ 3834:
13608
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
13607
+ /***/ ((module) => {
13609
13608
13610
13609
"use strict";
13611
13610
13612
13611
13613
- const assert = __nccwpck_require__(2613)
13614
- const { kHeadersList } = __nccwpck_require__(6443)
13615
-
13612
+ /**
13613
+ * @param {string} value
13614
+ * @returns {boolean}
13615
+ */
13616
13616
function isCTLExcludingHtab (value) {
13617
13617
if (value.length === 0) {
13618
13618
return false
@@ -13873,31 +13873,13 @@ function stringify (cookie) {
13873
13873
return out.join('; ')
13874
13874
}
13875
13875
13876
- let kHeadersListNode
13877
-
13878
- function getHeadersList (headers) {
13879
- if (headers[kHeadersList]) {
13880
- return headers[kHeadersList]
13881
- }
13882
-
13883
- if (!kHeadersListNode) {
13884
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
13885
- (symbol) => symbol.description === 'headers list'
13886
- )
13887
-
13888
- assert(kHeadersListNode, 'Headers cannot be parsed')
13889
- }
13890
-
13891
- const headersList = headers[kHeadersListNode]
13892
- assert(headersList)
13893
-
13894
- return headersList
13895
- }
13896
-
13897
13876
module.exports = {
13898
13877
isCTLExcludingHtab,
13899
- stringify,
13900
- getHeadersList
13878
+ validateCookieName,
13879
+ validateCookiePath,
13880
+ validateCookieValue,
13881
+ toIMFDate,
13882
+ stringify
13901
13883
}
13902
13884
13903
13885
@@ -17901,6 +17883,7 @@ const {
17901
17883
isValidHeaderName,
17902
17884
isValidHeaderValue
17903
17885
} = __nccwpck_require__(5523)
17886
+ const util = __nccwpck_require__(9023)
17904
17887
const { webidl } = __nccwpck_require__(4222)
17905
17888
const assert = __nccwpck_require__(2613)
17906
17889
@@ -18454,6 +18437,9 @@ Object.defineProperties(Headers.prototype, {
18454
18437
[Symbol.toStringTag]: {
18455
18438
value: 'Headers',
18456
18439
configurable: true
18440
+ },
18441
+ [util.inspect.custom]: {
18442
+ enumerable: false
18457
18443
}
18458
18444
})
18459
18445
@@ -27630,6 +27616,20 @@ class Pool extends PoolBase {
27630
27616
? { ...options.interceptors }
27631
27617
: undefined
27632
27618
this[kFactory] = factory
27619
+
27620
+ this.on('connectionError', (origin, targets, error) => {
27621
+ // If a connection error occurs, we remove the client from the pool,
27622
+ // and emit a connectionError event. They will not be re-used.
27623
+ // Fixes https://github.com/nodejs/undici/issues/3895
27624
+ for (const target of targets) {
27625
+ // Do not use kRemoveClient here, as it will close the client,
27626
+ // but the client cannot be closed in this state.
27627
+ const idx = this[kClients].indexOf(target)
27628
+ if (idx !== -1) {
27629
+ this[kClients].splice(idx, 1)
27630
+ }
27631
+ }
27632
+ })
27633
27633
}
27634
27634
27635
27635
[kGetDispatcher] () {
0 commit comments