@@ -10217,7 +10217,7 @@ module.exports = {
10217
10217
10218
10218
10219
10219
const { parseSetCookie } = __nccwpck_require__(8915)
10220
- const { stringify, getHeadersList } = __nccwpck_require__(3834)
10220
+ const { stringify } = __nccwpck_require__(3834)
10221
10221
const { webidl } = __nccwpck_require__(4222)
10222
10222
const { Headers } = __nccwpck_require__(6349)
10223
10223
@@ -10293,14 +10293,13 @@ function getSetCookies (headers) {
10293
10293
10294
10294
webidl.brandCheck(headers, Headers, { strict: false })
10295
10295
10296
- const cookies = getHeadersList( headers).cookies
10296
+ const cookies = headers.getSetCookie()
10297
10297
10298
10298
if (!cookies) {
10299
10299
return []
10300
10300
}
10301
10301
10302
- // In older versions of undici, cookies is a list of name:value.
10303
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
10302
+ return cookies.map((pair) => parseSetCookie(pair))
10304
10303
}
10305
10304
10306
10305
/**
@@ -10728,14 +10727,15 @@ module.exports = {
10728
10727
/***/ }),
10729
10728
10730
10729
/***/ 3834:
10731
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
10730
+ /***/ ((module) => {
10732
10731
10733
10732
"use strict";
10734
10733
10735
10734
10736
- const assert = __nccwpck_require__(2613)
10737
- const { kHeadersList } = __nccwpck_require__(6443)
10738
-
10735
+ /**
10736
+ * @param {string} value
10737
+ * @returns {boolean}
10738
+ */
10739
10739
function isCTLExcludingHtab (value) {
10740
10740
if (value.length === 0) {
10741
10741
return false
@@ -10996,31 +10996,13 @@ function stringify (cookie) {
10996
10996
return out.join('; ')
10997
10997
}
10998
10998
10999
- let kHeadersListNode
11000
-
11001
- function getHeadersList (headers) {
11002
- if (headers[kHeadersList]) {
11003
- return headers[kHeadersList]
11004
- }
11005
-
11006
- if (!kHeadersListNode) {
11007
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
11008
- (symbol) => symbol.description === 'headers list'
11009
- )
11010
-
11011
- assert(kHeadersListNode, 'Headers cannot be parsed')
11012
- }
11013
-
11014
- const headersList = headers[kHeadersListNode]
11015
- assert(headersList)
11016
-
11017
- return headersList
11018
- }
11019
-
11020
10999
module.exports = {
11021
11000
isCTLExcludingHtab,
11022
- stringify,
11023
- getHeadersList
11001
+ validateCookieName,
11002
+ validateCookiePath,
11003
+ validateCookieValue,
11004
+ toIMFDate,
11005
+ stringify
11024
11006
}
11025
11007
11026
11008
@@ -15024,6 +15006,7 @@ const {
15024
15006
isValidHeaderName,
15025
15007
isValidHeaderValue
15026
15008
} = __nccwpck_require__(5523)
15009
+ const util = __nccwpck_require__(9023)
15027
15010
const { webidl } = __nccwpck_require__(4222)
15028
15011
const assert = __nccwpck_require__(2613)
15029
15012
@@ -15577,6 +15560,9 @@ Object.defineProperties(Headers.prototype, {
15577
15560
[Symbol.toStringTag]: {
15578
15561
value: 'Headers',
15579
15562
configurable: true
15563
+ },
15564
+ [util.inspect.custom]: {
15565
+ enumerable: false
15580
15566
}
15581
15567
})
15582
15568
@@ -24753,6 +24739,20 @@ class Pool extends PoolBase {
24753
24739
? { ...options.interceptors }
24754
24740
: undefined
24755
24741
this[kFactory] = factory
24742
+
24743
+ this.on('connectionError', (origin, targets, error) => {
24744
+ // If a connection error occurs, we remove the client from the pool,
24745
+ // and emit a connectionError event. They will not be re-used.
24746
+ // Fixes https://github.com/nodejs/undici/issues/3895
24747
+ for (const target of targets) {
24748
+ // Do not use kRemoveClient here, as it will close the client,
24749
+ // but the client cannot be closed in this state.
24750
+ const idx = this[kClients].indexOf(target)
24751
+ if (idx !== -1) {
24752
+ this[kClients].splice(idx, 1)
24753
+ }
24754
+ }
24755
+ })
24756
24756
}
24757
24757
24758
24758
[kGetDispatcher] () {
0 commit comments