@@ -15617,7 +15617,7 @@ module.exports = {
1561715617
1561815618
1561915619const { parseSetCookie } = __nccwpck_require__(8915)
15620- const { stringify, getHeadersList } = __nccwpck_require__(3834)
15620+ const { stringify } = __nccwpck_require__(3834)
1562115621const { webidl } = __nccwpck_require__(4222)
1562215622const { Headers } = __nccwpck_require__(6349)
1562315623
@@ -15693,14 +15693,13 @@ function getSetCookies (headers) {
1569315693
1569415694 webidl.brandCheck(headers, Headers, { strict: false })
1569515695
15696- const cookies = getHeadersList( headers).cookies
15696+ const cookies = headers.getSetCookie()
1569715697
1569815698 if (!cookies) {
1569915699 return []
1570015700 }
1570115701
15702- // In older versions of undici, cookies is a list of name:value.
15703- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
15702+ return cookies.map((pair) => parseSetCookie(pair))
1570415703}
1570515704
1570615705/**
@@ -16128,14 +16127,15 @@ module.exports = {
1612816127/***/ }),
1612916128
1613016129/***/ 3834:
16131- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
16130+ /***/ ((module) => {
1613216131
1613316132"use strict";
1613416133
1613516134
16136- const assert = __nccwpck_require__(2613)
16137- const { kHeadersList } = __nccwpck_require__(6443)
16138-
16135+ /**
16136+ * @param {string} value
16137+ * @returns {boolean}
16138+ */
1613916139function isCTLExcludingHtab (value) {
1614016140 if (value.length === 0) {
1614116141 return false
@@ -16396,31 +16396,13 @@ function stringify (cookie) {
1639616396 return out.join('; ')
1639716397}
1639816398
16399- let kHeadersListNode
16400-
16401- function getHeadersList (headers) {
16402- if (headers[kHeadersList]) {
16403- return headers[kHeadersList]
16404- }
16405-
16406- if (!kHeadersListNode) {
16407- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
16408- (symbol) => symbol.description === 'headers list'
16409- )
16410-
16411- assert(kHeadersListNode, 'Headers cannot be parsed')
16412- }
16413-
16414- const headersList = headers[kHeadersListNode]
16415- assert(headersList)
16416-
16417- return headersList
16418- }
16419-
1642016399module.exports = {
1642116400 isCTLExcludingHtab,
16422- stringify,
16423- getHeadersList
16401+ validateCookieName,
16402+ validateCookiePath,
16403+ validateCookieValue,
16404+ toIMFDate,
16405+ stringify
1642416406}
1642516407
1642616408
@@ -20424,6 +20406,7 @@ const {
2042420406 isValidHeaderName,
2042520407 isValidHeaderValue
2042620408} = __nccwpck_require__(5523)
20409+ const util = __nccwpck_require__(9023)
2042720410const { webidl } = __nccwpck_require__(4222)
2042820411const assert = __nccwpck_require__(2613)
2042920412
@@ -20977,6 +20960,9 @@ Object.defineProperties(Headers.prototype, {
2097720960 [Symbol.toStringTag]: {
2097820961 value: 'Headers',
2097920962 configurable: true
20963+ },
20964+ [util.inspect.custom]: {
20965+ enumerable: false
2098020966 }
2098120967})
2098220968
@@ -30153,6 +30139,20 @@ class Pool extends PoolBase {
3015330139 ? { ...options.interceptors }
3015430140 : undefined
3015530141 this[kFactory] = factory
30142+
30143+ this.on('connectionError', (origin, targets, error) => {
30144+ // If a connection error occurs, we remove the client from the pool,
30145+ // and emit a connectionError event. They will not be re-used.
30146+ // Fixes https://github.com/nodejs/undici/issues/3895
30147+ for (const target of targets) {
30148+ // Do not use kRemoveClient here, as it will close the client,
30149+ // but the client cannot be closed in this state.
30150+ const idx = this[kClients].indexOf(target)
30151+ if (idx !== -1) {
30152+ this[kClients].splice(idx, 1)
30153+ }
30154+ }
30155+ })
3015630156 }
3015730157
3015830158 [kGetDispatcher] () {
0 commit comments