@@ -23491,7 +23491,7 @@ module.exports = {
2349123491
2349223492
2349323493const { parseSetCookie } = __nccwpck_require__(8915)
23494- const { stringify, getHeadersList } = __nccwpck_require__(3834)
23494+ const { stringify } = __nccwpck_require__(3834)
2349523495const { webidl } = __nccwpck_require__(4222)
2349623496const { Headers } = __nccwpck_require__(6349)
2349723497
@@ -23567,14 +23567,13 @@ function getSetCookies (headers) {
2356723567
2356823568 webidl.brandCheck(headers, Headers, { strict: false })
2356923569
23570- const cookies = getHeadersList( headers).cookies
23570+ const cookies = headers.getSetCookie()
2357123571
2357223572 if (!cookies) {
2357323573 return []
2357423574 }
2357523575
23576- // In older versions of undici, cookies is a list of name:value.
23577- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
23576+ return cookies.map((pair) => parseSetCookie(pair))
2357823577}
2357923578
2358023579/**
@@ -24002,14 +24001,15 @@ module.exports = {
2400224001/***/ }),
2400324002
2400424003/***/ 3834:
24005- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
24004+ /***/ ((module) => {
2400624005
2400724006"use strict";
2400824007
2400924008
24010- const assert = __nccwpck_require__(2613)
24011- const { kHeadersList } = __nccwpck_require__(6443)
24012-
24009+ /**
24010+ * @param {string} value
24011+ * @returns {boolean}
24012+ */
2401324013function isCTLExcludingHtab (value) {
2401424014 if (value.length === 0) {
2401524015 return false
@@ -24270,31 +24270,13 @@ function stringify (cookie) {
2427024270 return out.join('; ')
2427124271}
2427224272
24273- let kHeadersListNode
24274-
24275- function getHeadersList (headers) {
24276- if (headers[kHeadersList]) {
24277- return headers[kHeadersList]
24278- }
24279-
24280- if (!kHeadersListNode) {
24281- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
24282- (symbol) => symbol.description === 'headers list'
24283- )
24284-
24285- assert(kHeadersListNode, 'Headers cannot be parsed')
24286- }
24287-
24288- const headersList = headers[kHeadersListNode]
24289- assert(headersList)
24290-
24291- return headersList
24292- }
24293-
2429424273module.exports = {
2429524274 isCTLExcludingHtab,
24296- stringify,
24297- getHeadersList
24275+ validateCookieName,
24276+ validateCookiePath,
24277+ validateCookieValue,
24278+ toIMFDate,
24279+ stringify
2429824280}
2429924281
2430024282
@@ -26223,6 +26205,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(8253)
2622326205const { File: UndiciFile } = __nccwpck_require__(3041)
2622426206const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322)
2622526207
26208+ let random
26209+ try {
26210+ const crypto = __nccwpck_require__(7598)
26211+ random = (max) => crypto.randomInt(0, max)
26212+ } catch {
26213+ random = (max) => Math.floor(Math.random(max))
26214+ }
26215+
2622626216let ReadableStream = globalThis.ReadableStream
2622726217
2622826218/** @type {globalThis['File']} */
@@ -26308,7 +26298,7 @@ function extractBody (object, keepalive = false) {
2630826298 // Set source to a copy of the bytes held by object.
2630926299 source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
2631026300 } else if (util.isFormDataLike(object)) {
26311- const boundary = `----formdata-undici-0${`${Math.floor(Math. random() * 1e11)}`.padStart(11, '0')}`
26301+ const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
2631226302 const prefix = `--${boundary}\r\nContent-Disposition: form-data`
2631326303
2631426304 /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
@@ -28290,6 +28280,7 @@ const {
2829028280 isValidHeaderName,
2829128281 isValidHeaderValue
2829228282} = __nccwpck_require__(5523)
28283+ const util = __nccwpck_require__(9023)
2829328284const { webidl } = __nccwpck_require__(4222)
2829428285const assert = __nccwpck_require__(2613)
2829528286
@@ -28843,6 +28834,9 @@ Object.defineProperties(Headers.prototype, {
2884328834 [Symbol.toStringTag]: {
2884428835 value: 'Headers',
2884528836 configurable: true
28837+ },
28838+ [util.inspect.custom]: {
28839+ enumerable: false
2884628840 }
2884728841})
2884828842
@@ -38019,6 +38013,20 @@ class Pool extends PoolBase {
3801938013 ? { ...options.interceptors }
3802038014 : undefined
3802138015 this[kFactory] = factory
38016+
38017+ this.on('connectionError', (origin, targets, error) => {
38018+ // If a connection error occurs, we remove the client from the pool,
38019+ // and emit a connectionError event. They will not be re-used.
38020+ // Fixes https://github.com/nodejs/undici/issues/3895
38021+ for (const target of targets) {
38022+ // Do not use kRemoveClient here, as it will close the client,
38023+ // but the client cannot be closed in this state.
38024+ const idx = this[kClients].indexOf(target)
38025+ if (idx !== -1) {
38026+ this[kClients].splice(idx, 1)
38027+ }
38028+ }
38029+ })
3802238030 }
3802338031
3802438032 [kGetDispatcher] () {
@@ -40493,6 +40501,14 @@ module.exports = require("net");
4049340501
4049440502/***/ }),
4049540503
40504+ /***/ 7598:
40505+ /***/ ((module) => {
40506+
40507+ "use strict";
40508+ module.exports = require("node:crypto");
40509+
40510+ /***/ }),
40511+
4049640512/***/ 8474:
4049740513/***/ ((module) => {
4049840514
0 commit comments