@@ -23491,7 +23491,7 @@ module.exports = {
23491
23491
23492
23492
23493
23493
const { parseSetCookie } = __nccwpck_require__(8915)
23494
- const { stringify, getHeadersList } = __nccwpck_require__(3834)
23494
+ const { stringify } = __nccwpck_require__(3834)
23495
23495
const { webidl } = __nccwpck_require__(4222)
23496
23496
const { Headers } = __nccwpck_require__(6349)
23497
23497
@@ -23567,14 +23567,13 @@ function getSetCookies (headers) {
23567
23567
23568
23568
webidl.brandCheck(headers, Headers, { strict: false })
23569
23569
23570
- const cookies = getHeadersList( headers).cookies
23570
+ const cookies = headers.getSetCookie()
23571
23571
23572
23572
if (!cookies) {
23573
23573
return []
23574
23574
}
23575
23575
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))
23578
23577
}
23579
23578
23580
23579
/**
@@ -24002,14 +24001,15 @@ module.exports = {
24002
24001
/***/ }),
24003
24002
24004
24003
/***/ 3834:
24005
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__ ) => {
24004
+ /***/ ((module) => {
24006
24005
24007
24006
"use strict";
24008
24007
24009
24008
24010
- const assert = __nccwpck_require__(2613)
24011
- const { kHeadersList } = __nccwpck_require__(6443)
24012
-
24009
+ /**
24010
+ * @param {string} value
24011
+ * @returns {boolean}
24012
+ */
24013
24013
function isCTLExcludingHtab (value) {
24014
24014
if (value.length === 0) {
24015
24015
return false
@@ -24270,31 +24270,13 @@ function stringify (cookie) {
24270
24270
return out.join('; ')
24271
24271
}
24272
24272
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
-
24294
24273
module.exports = {
24295
24274
isCTLExcludingHtab,
24296
- stringify,
24297
- getHeadersList
24275
+ validateCookieName,
24276
+ validateCookiePath,
24277
+ validateCookieValue,
24278
+ toIMFDate,
24279
+ stringify
24298
24280
}
24299
24281
24300
24282
@@ -26223,6 +26205,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(8253)
26223
26205
const { File: UndiciFile } = __nccwpck_require__(3041)
26224
26206
const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322)
26225
26207
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
+
26226
26216
let ReadableStream = globalThis.ReadableStream
26227
26217
26228
26218
/** @type {globalThis['File']} */
@@ -26308,7 +26298,7 @@ function extractBody (object, keepalive = false) {
26308
26298
// Set source to a copy of the bytes held by object.
26309
26299
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
26310
26300
} 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')}`
26312
26302
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
26313
26303
26314
26304
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
@@ -28290,6 +28280,7 @@ const {
28290
28280
isValidHeaderName,
28291
28281
isValidHeaderValue
28292
28282
} = __nccwpck_require__(5523)
28283
+ const util = __nccwpck_require__(9023)
28293
28284
const { webidl } = __nccwpck_require__(4222)
28294
28285
const assert = __nccwpck_require__(2613)
28295
28286
@@ -28843,6 +28834,9 @@ Object.defineProperties(Headers.prototype, {
28843
28834
[Symbol.toStringTag]: {
28844
28835
value: 'Headers',
28845
28836
configurable: true
28837
+ },
28838
+ [util.inspect.custom]: {
28839
+ enumerable: false
28846
28840
}
28847
28841
})
28848
28842
@@ -38019,6 +38013,20 @@ class Pool extends PoolBase {
38019
38013
? { ...options.interceptors }
38020
38014
: undefined
38021
38015
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
+ })
38022
38030
}
38023
38031
38024
38032
[kGetDispatcher] () {
@@ -40493,6 +40501,14 @@ module.exports = require("net");
40493
40501
40494
40502
/***/ }),
40495
40503
40504
+ /***/ 7598:
40505
+ /***/ ((module) => {
40506
+
40507
+ "use strict";
40508
+ module.exports = require("node:crypto");
40509
+
40510
+ /***/ }),
40511
+
40496
40512
/***/ 8474:
40497
40513
/***/ ((module) => {
40498
40514
0 commit comments