diff --git a/get-changed-files/dist/index.js b/get-changed-files/dist/index.js index c91c758..7214ea8 100644 --- a/get-changed-files/dist/index.js +++ b/get-changed-files/dist/index.js @@ -2473,7 +2473,7 @@ exports.getProxyAgentDispatcher = getProxyAgentDispatcher; exports.getProxyFetch = getProxyFetch; exports.getApiBaseUrl = getApiBaseUrl; const httpClient = __importStar(__nccwpck_require__(5270)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -2725,7 +2725,7 @@ const http = __importStar(__nccwpck_require__(8611)); const https = __importStar(__nccwpck_require__(5692)); const pm = __importStar(__nccwpck_require__(9154)); const tunnel = __importStar(__nccwpck_require__(2695)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -4344,34 +4344,34 @@ exports.debug = debug; // for test /***/ }), -/***/ 9280: +/***/ 4782: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Client = __nccwpck_require__(5621) -const Dispatcher = __nccwpck_require__(6307) -const Pool = __nccwpck_require__(1748) -const BalancedPool = __nccwpck_require__(9717) -const Agent = __nccwpck_require__(8717) -const ProxyAgent = __nccwpck_require__(4800) -const EnvHttpProxyAgent = __nccwpck_require__(6753) -const RetryAgent = __nccwpck_require__(6770) -const errors = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +const Client = __nccwpck_require__(8223) +const Dispatcher = __nccwpck_require__(5353) +const Pool = __nccwpck_require__(5326) +const BalancedPool = __nccwpck_require__(9159) +const Agent = __nccwpck_require__(1891) +const ProxyAgent = __nccwpck_require__(5678) +const EnvHttpProxyAgent = __nccwpck_require__(7227) +const RetryAgent = __nccwpck_require__(8792) +const errors = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { InvalidArgumentError } = errors -const api = __nccwpck_require__(9719) -const buildConnector = __nccwpck_require__(6768) -const MockClient = __nccwpck_require__(4997) -const MockAgent = __nccwpck_require__(8269) -const MockPool = __nccwpck_require__(1828) -const mockErrors = __nccwpck_require__(93) -const RetryHandler = __nccwpck_require__(2728) -const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(197) -const DecoratorHandler = __nccwpck_require__(2587) -const RedirectHandler = __nccwpck_require__(5458) -const createRedirectInterceptor = __nccwpck_require__(7780) +const api = __nccwpck_require__(497) +const buildConnector = __nccwpck_require__(5634) +const MockClient = __nccwpck_require__(3735) +const MockAgent = __nccwpck_require__(3627) +const MockPool = __nccwpck_require__(6134) +const mockErrors = __nccwpck_require__(9539) +const RetryHandler = __nccwpck_require__(8022) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(6759) +const DecoratorHandler = __nccwpck_require__(3253) +const RedirectHandler = __nccwpck_require__(9104) +const createRedirectInterceptor = __nccwpck_require__(5914) Object.assign(Dispatcher.prototype, api) @@ -4389,10 +4389,10 @@ module.exports.DecoratorHandler = DecoratorHandler module.exports.RedirectHandler = RedirectHandler module.exports.createRedirectInterceptor = createRedirectInterceptor module.exports.interceptors = { - redirect: __nccwpck_require__(7594), - retry: __nccwpck_require__(9722), - dump: __nccwpck_require__(4972), - dns: __nccwpck_require__(4411) + redirect: __nccwpck_require__(2524), + retry: __nccwpck_require__(2644), + dump: __nccwpck_require__(6141), + dns: __nccwpck_require__(9765) } module.exports.buildConnector = buildConnector @@ -4454,7 +4454,7 @@ function makeDispatcher (fn) { module.exports.setGlobalDispatcher = setGlobalDispatcher module.exports.getGlobalDispatcher = getGlobalDispatcher -const fetchImpl = (__nccwpck_require__(782).fetch) +const fetchImpl = (__nccwpck_require__(5404).fetch) module.exports.fetch = async function fetch (init, options = undefined) { try { return await fetchImpl(init, options) @@ -4466,39 +4466,39 @@ module.exports.fetch = async function fetch (init, options = undefined) { throw err } } -module.exports.Headers = __nccwpck_require__(6548).Headers -module.exports.Response = __nccwpck_require__(2603).Response -module.exports.Request = __nccwpck_require__(6607).Request -module.exports.FormData = __nccwpck_require__(2198).FormData +module.exports.Headers = __nccwpck_require__(4478).Headers +module.exports.Response = __nccwpck_require__(5093).Response +module.exports.Request = __nccwpck_require__(2257).Request +module.exports.FormData = __nccwpck_require__(7064).FormData module.exports.File = globalThis.File ?? (__nccwpck_require__(4573).File) -module.exports.FileReader = __nccwpck_require__(9395).FileReader +module.exports.FileReader = __nccwpck_require__(6705).FileReader -const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(5699) +const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(7573) module.exports.setGlobalOrigin = setGlobalOrigin module.exports.getGlobalOrigin = getGlobalOrigin -const { CacheStorage } = __nccwpck_require__(8733) -const { kConstruct } = __nccwpck_require__(2045) +const { CacheStorage } = __nccwpck_require__(2363) +const { kConstruct } = __nccwpck_require__(4527) // Cache & CacheStorage are tightly coupled with fetch. Even if it may run // in an older version of Node, it doesn't have any use without fetch. module.exports.caches = new CacheStorage(kConstruct) -const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1973) +const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(6783) module.exports.deleteCookie = deleteCookie module.exports.getCookies = getCookies module.exports.getSetCookies = getSetCookies module.exports.setCookie = setCookie -const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(8828) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4622) module.exports.parseMIMEType = parseMIMEType module.exports.serializeAMimeType = serializeAMimeType -const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(8916) -module.exports.WebSocket = __nccwpck_require__(5134).WebSocket +const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(4926) +module.exports.WebSocket = __nccwpck_require__(9480).WebSocket module.exports.CloseEvent = CloseEvent module.exports.ErrorEvent = ErrorEvent module.exports.MessageEvent = MessageEvent @@ -4514,18 +4514,18 @@ module.exports.MockPool = MockPool module.exports.MockAgent = MockAgent module.exports.mockErrors = mockErrors -const { EventSource } = __nccwpck_require__(4886) +const { EventSource } = __nccwpck_require__(5768) module.exports.EventSource = EventSource /***/ }), -/***/ 1006: +/***/ 6720: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { addAbortListener } = __nccwpck_require__(3792) -const { RequestAbortedError } = __nccwpck_require__(9715) +const { addAbortListener } = __nccwpck_require__(2250) +const { RequestAbortedError } = __nccwpck_require__(7617) const kListener = Symbol('kListener') const kSignal = Symbol('kSignal') @@ -4585,7 +4585,7 @@ module.exports = { /***/ }), -/***/ 2772: +/***/ 6958: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4593,9 +4593,9 @@ module.exports = { const assert = __nccwpck_require__(4589) const { AsyncResource } = __nccwpck_require__(6698) -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class ConnectHandler extends AsyncResource { constructor (opts, callback) { @@ -4701,7 +4701,7 @@ module.exports = connect /***/ }), -/***/ 2846: +/***/ 8084: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4716,10 +4716,10 @@ const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) const kResume = Symbol('resume') @@ -4960,17 +4960,17 @@ module.exports = pipeline /***/ }), -/***/ 8875: +/***/ 353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { Readable } = __nccwpck_require__(3159) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { Readable } = __nccwpck_require__(105) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) class RequestHandler extends AsyncResource { @@ -5182,7 +5182,7 @@ module.exports.RequestHandler = RequestHandler /***/ }), -/***/ 9560: +/***/ 7010: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -5190,11 +5190,11 @@ module.exports.RequestHandler = RequestHandler const assert = __nccwpck_require__(4589) const { finished, PassThrough } = __nccwpck_require__(7075) -const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { @@ -5410,16 +5410,16 @@ module.exports = stream /***/ }), -/***/ 6538: +/***/ 7312: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) const { AsyncResource } = __nccwpck_require__(6698) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) class UpgradeHandler extends AsyncResource { @@ -5526,22 +5526,22 @@ module.exports = upgrade /***/ }), -/***/ 9719: +/***/ 497: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports.request = __nccwpck_require__(8875) -module.exports.stream = __nccwpck_require__(9560) -module.exports.pipeline = __nccwpck_require__(2846) -module.exports.upgrade = __nccwpck_require__(6538) -module.exports.connect = __nccwpck_require__(2772) +module.exports.request = __nccwpck_require__(353) +module.exports.stream = __nccwpck_require__(7010) +module.exports.pipeline = __nccwpck_require__(8084) +module.exports.upgrade = __nccwpck_require__(7312) +module.exports.connect = __nccwpck_require__(6958) /***/ }), -/***/ 3159: +/***/ 105: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -5551,9 +5551,9 @@ module.exports.connect = __nccwpck_require__(2772) const assert = __nccwpck_require__(4589) const { Readable } = __nccwpck_require__(7075) -const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { ReadableStreamFrom } = __nccwpck_require__(3792) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { ReadableStreamFrom } = __nccwpck_require__(2250) const kConsume = Symbol('kConsume') const kReading = Symbol('kReading') @@ -5934,15 +5934,15 @@ module.exports = { Readable: BodyReadable, chunksDecode } /***/ }), -/***/ 343: +/***/ 1337: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) const { ResponseStatusCodeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) -const { chunksDecode } = __nccwpck_require__(3159) +const { chunksDecode } = __nccwpck_require__(105) const CHUNK_LIMIT = 128 * 1024 async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { @@ -6034,7 +6034,7 @@ module.exports = { /***/ }), -/***/ 6768: +/***/ 5634: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -6042,9 +6042,9 @@ module.exports = { const net = __nccwpck_require__(7030) const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(9715) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(7617) +const timers = __nccwpck_require__(2841) function noop () {} @@ -6282,7 +6282,7 @@ module.exports = buildConnector /***/ }), -/***/ 2239: +/***/ 885: /***/ ((module) => { "use strict"; @@ -6408,7 +6408,7 @@ module.exports = { /***/ }), -/***/ 7822: +/***/ 6692: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -6618,7 +6618,7 @@ module.exports = { /***/ }), -/***/ 9715: +/***/ 7617: /***/ ((module) => { "use strict"; @@ -7051,7 +7051,7 @@ module.exports = { /***/ }), -/***/ 8655: +/***/ 7533: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -7060,7 +7060,7 @@ module.exports = { const { InvalidArgumentError, NotSupportedError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const assert = __nccwpck_require__(4589) const { isValidHTTPToken, @@ -7075,9 +7075,9 @@ const { validateHandler, getServerName, normalizedMethodRecords -} = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) +} = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) // Verifies that a given path is valid does not contain control chars \x00 to \x20 const invalidPathRegex = /[^\u0021-\u00ff]/ @@ -7464,7 +7464,7 @@ module.exports = Request /***/ }), -/***/ 1675: +/***/ 8705: /***/ ((module) => { module.exports = { @@ -7538,7 +7538,7 @@ module.exports = { /***/ }), -/***/ 4184: +/***/ 8174: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -7547,7 +7547,7 @@ module.exports = { const { wellknownHeaderNames, headerNameLowerCasedRecord -} = __nccwpck_require__(2239) +} = __nccwpck_require__(885) class TstNode { /** @type {any} */ @@ -7698,14 +7698,14 @@ module.exports = { /***/ }), -/***/ 3792: +/***/ 2250: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(1675) +const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(8705) const { IncomingMessage } = __nccwpck_require__(7067) const stream = __nccwpck_require__(7075) const net = __nccwpck_require__(7030) @@ -7713,9 +7713,9 @@ const { Blob } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) const { stringify } = __nccwpck_require__(1792) const { EventEmitter: EE } = __nccwpck_require__(8474) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) -const { tree } = __nccwpck_require__(4184) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) +const { tree } = __nccwpck_require__(8174) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) @@ -8425,19 +8425,19 @@ module.exports = { /***/ }), -/***/ 8717: +/***/ 1891: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) -const DispatcherBase = __nccwpck_require__(9921) -const Pool = __nccwpck_require__(1748) -const Client = __nccwpck_require__(5621) -const util = __nccwpck_require__(3792) -const createRedirectInterceptor = __nccwpck_require__(7780) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) +const DispatcherBase = __nccwpck_require__(2403) +const Pool = __nccwpck_require__(5326) +const Client = __nccwpck_require__(8223) +const util = __nccwpck_require__(2250) +const createRedirectInterceptor = __nccwpck_require__(5914) const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') @@ -8455,7 +8455,6 @@ function defaultFactory (origin, opts) { class Agent extends DispatcherBase { constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } @@ -8563,7 +8562,7 @@ module.exports = Agent /***/ }), -/***/ 9717: +/***/ 9159: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -8572,7 +8571,7 @@ module.exports = Agent const { BalancedPoolMissingUpstreamError, InvalidArgumentError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { PoolBase, kClients, @@ -8580,10 +8579,10 @@ const { kAddClient, kRemoveClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Pool = __nccwpck_require__(1748) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const { parseOrigin } = __nccwpck_require__(3792) +} = __nccwpck_require__(7262) +const Pool = __nccwpck_require__(5326) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const { parseOrigin } = __nccwpck_require__(2250) const kFactory = Symbol('factory') const kOptions = Symbol('options') @@ -8780,7 +8779,7 @@ module.exports = BalancedPool /***/ }), -/***/ 2285: +/***/ 8875: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -8789,9 +8788,9 @@ module.exports = BalancedPool /* global WebAssembly */ const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const timers = __nccwpck_require__(2841) const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, @@ -8803,7 +8802,7 @@ const { BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -8836,22 +8835,25 @@ const { kOnError, kResume, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) -const constants = __nccwpck_require__(9368) +const constants = __nccwpck_require__(6882) const EMPTY_BUF = Buffer.alloc(0) const FastBuffer = Buffer[Symbol.species] const addListener = util.addListener const removeAllListeners = util.removeAllListeners +const kIdleSocketValidation = Symbol('kIdleSocketValidation') +const kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout') +const kSocketUsed = Symbol('kSocketUsed') let extractBody async function lazyllhttp () { - const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(798) : undefined + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(4728) : undefined let mod try { - mod = await WebAssembly.compile(__nccwpck_require__(4682)) + mod = await WebAssembly.compile(__nccwpck_require__(5984)) } catch (e) { /* istanbul ignore next */ @@ -8859,7 +8861,7 @@ async function lazyllhttp () { // being enabled, but the occurring of this other error // * https://github.com/emscripten-core/emscripten/issues/11495 // got me to remove that check to avoid breaking Node 12. - mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(798)) + mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(4728)) } return await WebAssembly.instantiate(mod, { @@ -9065,29 +9067,71 @@ class Parser { const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr - if (ret === constants.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(data.slice(offset)) - } else if (ret === constants.ERROR.PAUSED) { - this.paused = true - socket.unshift(data.slice(offset)) - } else if (ret !== constants.ERROR.OK) { - const ptr = llhttp.llhttp_get_error_reason(this.ptr) - let message = '' - /* istanbul ignore else: difficult to make a test case for */ - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) - message = - 'Response does not match the HTTP/1.1 protocol (' + - Buffer.from(llhttp.memory.buffer, ptr, len).toString() + - ')' - } - throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + if (ret !== constants.ERROR.OK) { + const body = data.subarray(offset) + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(body) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(body) + } else { + throw this.createError(ret, body) + } } } catch (err) { util.destroy(socket, err) } } + finish () { + assert(currentParser === null) + assert(this.ptr != null) + assert(!this.paused) + + const { llhttp } = this + + let ret + + try { + currentParser = this + ret = llhttp.llhttp_finish(this.ptr) + } finally { + currentParser = null + } + + if (ret === constants.ERROR.OK) { + return null + } + + if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { + this.paused = true + return null + } + + return this.createError(ret, EMPTY_BUF) + } + + createError (ret, data) { + const { llhttp, contentLength, bytesRead } = this + + if (contentLength && bytesRead !== parseInt(contentLength, 10)) { + return new ResponseContentLengthMismatchError() + } + + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + + return new HTTPParserError(message, constants.ERROR[ret], data) + } + destroy () { assert(this.ptr != null) assert(currentParser == null) @@ -9115,6 +9159,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] if (!request) { return -1 @@ -9218,6 +9267,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] /* istanbul ignore next: difficult to make a test case for */ @@ -9391,6 +9445,7 @@ class Parser { request.onComplete(headers) client[kQueue][client[kRunningIdx]++] = null + socket[kSocketUsed] = true if (socket[kWriting]) { assert(client[kRunning] === 0) @@ -9449,6 +9504,9 @@ async function connectH1 (client, socket) { socket[kWriting] = false socket[kReset] = false socket[kBlocking] = false + socket[kIdleSocketValidation] = 0 + socket[kIdleSocketValidationTimeout] = null + socket[kSocketUsed] = false socket[kParser] = new Parser(client, socket, llhttpInstance) addListener(socket, 'error', function (err) { @@ -9459,8 +9517,11 @@ async function connectH1 (client, socket) { // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded // to the user. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so for as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + this[kError] = parserErr + this[kClient][kOnError](parserErr) + } return } @@ -9479,8 +9540,10 @@ async function connectH1 (client, socket) { const parser = this[kParser] if (parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + util.destroy(this, parserErr) + } return } @@ -9490,10 +9553,11 @@ async function connectH1 (client, socket) { const client = this[kClient] const parser = this[kParser] + clearIdleSocketValidation(this) + if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + this[kError] = parser.finish() || this[kError] } this[kParser].destroy() @@ -9556,7 +9620,7 @@ async function connectH1 (client, socket) { return socket.destroyed }, busy (request) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) { return true } @@ -9594,6 +9658,31 @@ async function connectH1 (client, socket) { } } +function clearIdleSocketValidation (socket) { + if (socket[kIdleSocketValidationTimeout]) { + clearTimeout(socket[kIdleSocketValidationTimeout]) + socket[kIdleSocketValidationTimeout] = null + } + + socket[kIdleSocketValidation] = 0 +} + +function scheduleIdleSocketValidation (client, socket) { + socket[kIdleSocketValidation] = 1 + socket[kIdleSocketValidationTimeout] = setTimeout(() => { + socket[kIdleSocketValidationTimeout] = null + socket[kIdleSocketValidation] = 2 + + if (client[kSocket] === socket && !socket.destroyed) { + client[kResume]() + } + }, 0) + socket[kIdleSocketValidationTimeout].unref?.() +} + +/** + * @param {import('./client.js')} client + */ function resumeH1 (client) { const socket = client[kSocket] @@ -9608,6 +9697,32 @@ function resumeH1 (client) { socket[kNoRef] = false } + if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) { + if (socket[kIdleSocketValidation] === 0) { + scheduleIdleSocketValidation(client, socket) + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + + if (socket[kIdleSocketValidation] === 1) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + } + + if (client[kRunning] === 0) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + } + if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE) @@ -9654,7 +9769,7 @@ function writeH1 (client, request) { if (util.isFormDataLike(body)) { if (!extractBody) { - extractBody = (__nccwpck_require__(220).extractBody) + extractBody = (__nccwpck_require__(3682).extractBody) } const [bodyStream, contentType] = extractBody(body) @@ -9701,6 +9816,7 @@ function writeH1 (client, request) { } const socket = client[kSocket] + clearIdleSocketValidation(socket) const abort = (err) => { if (request.aborted || request.completed) { @@ -10158,7 +10274,7 @@ module.exports = connectH1 /***/ }), -/***/ 4164: +/***/ 7662: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10166,13 +10282,13 @@ module.exports = connectH1 const assert = __nccwpck_require__(4589) const { pipeline } = __nccwpck_require__(7075) -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -10191,7 +10307,7 @@ const { kResume, kSize, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) const kOpenStreams = Symbol('open streams') @@ -10550,7 +10666,7 @@ function writeH2 (client, request) { let contentLength = util.bodyLength(body) if (util.isFormDataLike(body)) { - extractBody ??= (__nccwpck_require__(220).extractBody) + extractBody ??= (__nccwpck_require__(3682).extractBody) const [bodyStream, contentType] = extractBody(body) headers['content-type'] = contentType @@ -10910,7 +11026,7 @@ module.exports = connectH2 /***/ }), -/***/ 5621: +/***/ 8223: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10921,16 +11037,16 @@ module.exports = connectH2 const assert = __nccwpck_require__(4589) const net = __nccwpck_require__(7030) const http = __nccwpck_require__(7067) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const Request = __nccwpck_require__(8655) -const DispatcherBase = __nccwpck_require__(9921) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const Request = __nccwpck_require__(7533) +const DispatcherBase = __nccwpck_require__(2403) const { InvalidArgumentError, InformationalError, ClientDestroyedError -} = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) const { kUrl, kServerName, @@ -10972,9 +11088,9 @@ const { kHTTPContext, kMaxConcurrentStreams, kResume -} = __nccwpck_require__(1675) -const connectH1 = __nccwpck_require__(2285) -const connectH2 = __nccwpck_require__(4164) +} = __nccwpck_require__(8705) +const connectH1 = __nccwpck_require__(8875) +const connectH2 = __nccwpck_require__(7662) let deprecatedInterceptorWarned = false const kClosedResolve = Symbol('kClosedResolve') @@ -11281,7 +11397,7 @@ class Client extends DispatcherBase { } } -const createRedirectInterceptor = __nccwpck_require__(7780) +const createRedirectInterceptor = __nccwpck_require__(5914) function onError (client, err) { if ( @@ -11541,19 +11657,19 @@ module.exports = Client /***/ }), -/***/ 9921: +/***/ 2403: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) +const Dispatcher = __nccwpck_require__(5353) const { ClientDestroyedError, ClientClosedError, InvalidArgumentError -} = __nccwpck_require__(9715) -const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(1675) +} = __nccwpck_require__(7617) +const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(8705) const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') @@ -11573,6 +11689,7 @@ class DispatcherBase extends Dispatcher { get webSocketOptions () { return { + maxFragments: this[kWebSocketOptions].maxFragments ?? 131072, maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 } } @@ -11747,7 +11864,7 @@ module.exports = DispatcherBase /***/ }), -/***/ 6307: +/***/ 5353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -11820,16 +11937,16 @@ module.exports = Dispatcher /***/ }), -/***/ 6753: +/***/ 7227: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(1675) -const ProxyAgent = __nccwpck_require__(4800) -const Agent = __nccwpck_require__(8717) +const DispatcherBase = __nccwpck_require__(2403) +const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(8705) +const ProxyAgent = __nccwpck_require__(5678) +const Agent = __nccwpck_require__(1891) const DEFAULT_PORTS = { 'http:': 80, @@ -11988,7 +12105,7 @@ module.exports = EnvHttpProxyAgent /***/ }), -/***/ 8692: +/***/ 894: /***/ ((module) => { "use strict"; @@ -12113,16 +12230,16 @@ module.exports = class FixedQueue { /***/ }), -/***/ 2192: +/***/ 7262: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const FixedQueue = __nccwpck_require__(8692) -const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(1675) -const PoolStats = __nccwpck_require__(206) +const DispatcherBase = __nccwpck_require__(2403) +const FixedQueue = __nccwpck_require__(894) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(8705) +const PoolStats = __nccwpck_require__(3264) const kClients = Symbol('clients') const kNeedDrain = Symbol('needDrain') @@ -12315,10 +12432,10 @@ module.exports = { /***/ }), -/***/ 206: +/***/ 3264: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(1675) +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(8705) const kPool = Symbol('pool') class PoolStats { @@ -12356,7 +12473,7 @@ module.exports = PoolStats /***/ }), -/***/ 1748: +/***/ 5326: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -12368,14 +12485,14 @@ const { kNeedDrain, kAddClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Client = __nccwpck_require__(5621) +} = __nccwpck_require__(7262) +const Client = __nccwpck_require__(8223) const { InvalidArgumentError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const buildConnector = __nccwpck_require__(5634) const kOptions = Symbol('options') const kConnections = Symbol('connections') @@ -12471,20 +12588,20 @@ module.exports = Pool /***/ }), -/***/ 4800: +/***/ 5678: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) +const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) const { URL } = __nccwpck_require__(3136) -const Agent = __nccwpck_require__(8717) -const Pool = __nccwpck_require__(1748) -const DispatcherBase = __nccwpck_require__(9921) -const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) -const Client = __nccwpck_require__(5621) +const Agent = __nccwpck_require__(1891) +const Pool = __nccwpck_require__(5326) +const DispatcherBase = __nccwpck_require__(2403) +const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) +const Client = __nccwpck_require__(8223) const kAgent = Symbol('proxy agent') const kClient = Symbol('proxy client') @@ -12753,14 +12870,14 @@ module.exports = ProxyAgent /***/ }), -/***/ 6770: +/***/ 8792: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) -const RetryHandler = __nccwpck_require__(2728) +const Dispatcher = __nccwpck_require__(5353) +const RetryHandler = __nccwpck_require__(8022) class RetryAgent extends Dispatcher { #agent = null @@ -12796,7 +12913,7 @@ module.exports = RetryAgent /***/ }), -/***/ 197: +/***/ 6759: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -12805,8 +12922,8 @@ module.exports = RetryAgent // We include a version number for the Dispatcher API. In case of breaking changes, // this version number must be increased to avoid conflicts. const globalDispatcher = Symbol.for('undici.globalDispatcher.1') -const { InvalidArgumentError } = __nccwpck_require__(9715) -const Agent = __nccwpck_require__(8717) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const Agent = __nccwpck_require__(1891) if (getGlobalDispatcher() === undefined) { setGlobalDispatcher(new Agent()) @@ -12836,7 +12953,7 @@ module.exports = { /***/ }), -/***/ 2587: +/***/ 3253: /***/ ((module) => { "use strict"; @@ -12888,16 +13005,16 @@ module.exports = class DecoratorHandler { /***/ }), -/***/ 5458: +/***/ 9104: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { kBodyUsed } = __nccwpck_require__(1675) +const util = __nccwpck_require__(2250) +const { kBodyUsed } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) -const { InvalidArgumentError } = __nccwpck_require__(9715) +const { InvalidArgumentError } = __nccwpck_require__(7617) const EE = __nccwpck_require__(8474) const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] @@ -13128,21 +13245,21 @@ module.exports = RedirectHandler /***/ }), -/***/ 2728: +/***/ 8022: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kRetryHandlerDefaultRetry } = __nccwpck_require__(1675) -const { RequestRetryError } = __nccwpck_require__(9715) +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(8705) +const { RequestRetryError } = __nccwpck_require__(7617) const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody -} = __nccwpck_require__(3792) +} = __nccwpck_require__(2250) function calculateRetryAfterHeader (retryAfter) { const current = Date.now() @@ -13510,15 +13627,15 @@ module.exports = RetryHandler /***/ }), -/***/ 4411: +/***/ 9765: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { isIP } = __nccwpck_require__(7030) const { lookup } = __nccwpck_require__(610) -const DecoratorHandler = __nccwpck_require__(2587) -const { InvalidArgumentError, InformationalError } = __nccwpck_require__(9715) +const DecoratorHandler = __nccwpck_require__(3253) +const { InvalidArgumentError, InformationalError } = __nccwpck_require__(7617) const maxInt = Math.pow(2, 31) - 1 class DNSInstance { @@ -13893,15 +14010,15 @@ module.exports = interceptorOpts => { /***/ }), -/***/ 4972: +/***/ 6141: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const DecoratorHandler = __nccwpck_require__(2587) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const DecoratorHandler = __nccwpck_require__(3253) class DumpHandler extends DecoratorHandler { #maxSize = 1024 * 1024 @@ -14024,13 +14141,13 @@ module.exports = createDumpInterceptor /***/ }), -/***/ 7780: +/***/ 5914: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { @@ -14053,12 +14170,12 @@ module.exports = createRedirectInterceptor /***/ }), -/***/ 7594: +/***/ 2524: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) module.exports = opts => { const globalMaxRedirections = opts?.maxRedirections @@ -14085,12 +14202,12 @@ module.exports = opts => { /***/ }), -/***/ 9722: +/***/ 2644: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RetryHandler = __nccwpck_require__(2728) +const RetryHandler = __nccwpck_require__(8022) module.exports = globalOpts => { return dispatch => { @@ -14112,14 +14229,14 @@ module.exports = globalOpts => { /***/ }), -/***/ 9368: +/***/ 6882: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; -const utils_1 = __nccwpck_require__(2316); +const utils_1 = __nccwpck_require__(2234); // C headers var ERROR; (function (ERROR) { @@ -14397,7 +14514,7 @@ exports.SPECIAL_HEADERS = { /***/ }), -/***/ 798: +/***/ 4728: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -14410,7 +14527,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 4682: +/***/ 5984: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -14423,7 +14540,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 2316: +/***/ 2234: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -14445,14 +14562,14 @@ exports.enumToMap = enumToMap; /***/ }), -/***/ 8269: +/***/ 3627: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kClients } = __nccwpck_require__(1675) -const Agent = __nccwpck_require__(8717) +const { kClients } = __nccwpck_require__(8705) +const Agent = __nccwpck_require__(1891) const { kAgent, kMockAgentSet, @@ -14463,14 +14580,14 @@ const { kGetNetConnect, kOptions, kFactory -} = __nccwpck_require__(4093) -const MockClient = __nccwpck_require__(4997) -const MockPool = __nccwpck_require__(1828) -const { matchValue, buildMockOptions } = __nccwpck_require__(3589) -const { InvalidArgumentError, UndiciError } = __nccwpck_require__(9715) -const Dispatcher = __nccwpck_require__(6307) -const Pluralizer = __nccwpck_require__(5097) -const PendingInterceptorsFormatter = __nccwpck_require__(9758) +} = __nccwpck_require__(4251) +const MockClient = __nccwpck_require__(3735) +const MockPool = __nccwpck_require__(6134) +const { matchValue, buildMockOptions } = __nccwpck_require__(6031) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(7617) +const Dispatcher = __nccwpck_require__(5353) +const Pluralizer = __nccwpck_require__(1591) +const PendingInterceptorsFormatter = __nccwpck_require__(9236) class MockAgent extends Dispatcher { constructor (opts) { @@ -14613,15 +14730,15 @@ module.exports = MockAgent /***/ }), -/***/ 4997: +/***/ 3735: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Client = __nccwpck_require__(5621) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Client = __nccwpck_require__(8223) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -14630,10 +14747,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockClient provides an API that extends the Client to influence the mockDispatches. @@ -14680,13 +14797,13 @@ module.exports = MockClient /***/ }), -/***/ 93: +/***/ 9539: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { UndiciError } = __nccwpck_require__(9715) +const { UndiciError } = __nccwpck_require__(7617) const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED') @@ -14716,13 +14833,13 @@ module.exports = { /***/ }), -/***/ 6039: +/***/ 3969: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3589) +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kDispatchKey, @@ -14730,9 +14847,9 @@ const { kDefaultTrailers, kContentLength, kMockDispatch -} = __nccwpck_require__(4093) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { buildURL } = __nccwpck_require__(2250) /** * Defines the scope API for an interceptor reply @@ -14931,15 +15048,15 @@ module.exports.MockScope = MockScope /***/ }), -/***/ 1828: +/***/ 6134: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Pool = __nccwpck_require__(1748) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Pool = __nccwpck_require__(5326) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -14948,10 +15065,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockPool provides an API that extends the Pool to influence the mockDispatches. @@ -14998,7 +15115,7 @@ module.exports = MockPool /***/ }), -/***/ 4093: +/***/ 4251: /***/ ((module) => { "use strict"; @@ -15029,21 +15146,21 @@ module.exports = { /***/ }), -/***/ 3589: +/***/ 6031: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { MockNotMatchedError } = __nccwpck_require__(93) +const { MockNotMatchedError } = __nccwpck_require__(9539) const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect -} = __nccwpck_require__(4093) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { buildURL } = __nccwpck_require__(2250) const { STATUS_CODES } = __nccwpck_require__(7067) const { types: { @@ -15404,7 +15521,7 @@ module.exports = { /***/ }), -/***/ 9758: +/***/ 9236: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -15455,7 +15572,7 @@ module.exports = class PendingInterceptorsFormatter { /***/ }), -/***/ 5097: +/***/ 1591: /***/ ((module) => { "use strict"; @@ -15492,7 +15609,7 @@ module.exports = class Pluralizer { /***/ }), -/***/ 1915: +/***/ 2841: /***/ ((module) => { "use strict"; @@ -15923,21 +16040,21 @@ module.exports = { /***/ }), -/***/ 5714: +/***/ 9556: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { urlEquals, getFieldValues } = __nccwpck_require__(8094) -const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3792) -const { webidl } = __nccwpck_require__(613) -const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(2603) -const { Request, fromInnerRequest } = __nccwpck_require__(6607) -const { kState } = __nccwpck_require__(2043) -const { fetching } = __nccwpck_require__(782) -const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9808) +const { kConstruct } = __nccwpck_require__(4527) +const { urlEquals, getFieldValues } = __nccwpck_require__(7900) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(2250) +const { webidl } = __nccwpck_require__(4195) +const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(5093) +const { Request, fromInnerRequest } = __nccwpck_require__(2257) +const { kState } = __nccwpck_require__(4701) +const { fetching } = __nccwpck_require__(5404) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9614) const assert = __nccwpck_require__(4589) /** @@ -16790,16 +16907,16 @@ module.exports = { /***/ }), -/***/ 8733: +/***/ 2363: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { Cache } = __nccwpck_require__(5714) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(4527) +const { Cache } = __nccwpck_require__(9556) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class CacheStorage { /** @@ -16950,28 +17067,28 @@ module.exports = { /***/ }), -/***/ 2045: +/***/ 4527: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - kConstruct: (__nccwpck_require__(1675).kConstruct) + kConstruct: (__nccwpck_require__(8705).kConstruct) } /***/ }), -/***/ 8094: +/***/ 7900: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { URLSerializer } = __nccwpck_require__(8828) -const { isValidHeaderName } = __nccwpck_require__(9808) +const { URLSerializer } = __nccwpck_require__(4622) +const { isValidHeaderName } = __nccwpck_require__(9614) /** * @see https://url.spec.whatwg.org/#concept-url-equals @@ -17016,7 +17133,7 @@ module.exports = { /***/ }), -/***/ 924: +/***/ 8498: /***/ ((module) => { "use strict"; @@ -17036,16 +17153,16 @@ module.exports = { /***/ }), -/***/ 1973: +/***/ 6783: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { parseSetCookie } = __nccwpck_require__(3498) -const { stringify } = __nccwpck_require__(4533) -const { webidl } = __nccwpck_require__(613) -const { Headers } = __nccwpck_require__(6548) +const { parseSetCookie } = __nccwpck_require__(9032) +const { stringify } = __nccwpck_require__(6095) +const { webidl } = __nccwpck_require__(4195) +const { Headers } = __nccwpck_require__(4478) /** * @typedef {Object} Cookie @@ -17228,15 +17345,15 @@ module.exports = { /***/ }), -/***/ 3498: +/***/ 9032: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(924) -const { isCTLExcludingHtab } = __nccwpck_require__(4533) -const { collectASequenceOfCodePointsFast } = __nccwpck_require__(8828) +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(8498) +const { isCTLExcludingHtab } = __nccwpck_require__(6095) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4622) const assert = __nccwpck_require__(4589) /** @@ -17509,32 +17626,25 @@ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) // If the attribute-name case-insensitively matches the string // "SameSite", the user agent MUST process the cookie-av as follows: - // 1. Let enforcement be "Default". - let enforcement = 'Default' - const attributeValueLowercase = attributeValue.toLowerCase() - // 2. If cookie-av's attribute-value is a case-insensitive match for - // "None", set enforcement to "None". - if (attributeValueLowercase.includes('none')) { - enforcement = 'None' - } - // 3. If cookie-av's attribute-value is a case-insensitive match for - // "Strict", set enforcement to "Strict". - if (attributeValueLowercase.includes('strict')) { - enforcement = 'Strict' + // 1. If cookie-av's attribute-value is a case-insensitive match for + // "None", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "None". + if (attributeValueLowercase === 'none') { + cookieAttributeList.sameSite = 'None' + } else if (attributeValueLowercase === 'strict') { + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", append an attribute to the cookie-attribute-list with + // an attribute-name of "SameSite" and an attribute-value of + // "Strict". + cookieAttributeList.sameSite = 'Strict' + } else if (attributeValueLowercase === 'lax') { + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "Lax". + cookieAttributeList.sameSite = 'Lax' } - - // 4. If cookie-av's attribute-value is a case-insensitive match for - // "Lax", set enforcement to "Lax". - if (attributeValueLowercase.includes('lax')) { - enforcement = 'Lax' - } - - // 5. Append an attribute to the cookie-attribute-list with an - // attribute-name of "SameSite" and an attribute-value of - // enforcement. - cookieAttributeList.sameSite = enforcement } else { cookieAttributeList.unparsed ??= [] @@ -17553,7 +17663,7 @@ module.exports = { /***/ }), -/***/ 4533: +/***/ 6095: /***/ ((module) => { "use strict"; @@ -17843,13 +17953,13 @@ module.exports = { /***/ }), -/***/ 8735: +/***/ 1581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Transform } = __nccwpck_require__(7075) -const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(3867) +const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5537) /** * @type {number[]} BOM @@ -18249,23 +18359,23 @@ module.exports = { /***/ }), -/***/ 4886: +/***/ 5768: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { pipeline } = __nccwpck_require__(7075) -const { fetching } = __nccwpck_require__(782) -const { makeRequest } = __nccwpck_require__(6607) -const { webidl } = __nccwpck_require__(613) -const { EventSourceStream } = __nccwpck_require__(8735) -const { parseMIMEType } = __nccwpck_require__(8828) -const { createFastMessageEvent } = __nccwpck_require__(8916) -const { isNetworkError } = __nccwpck_require__(2603) -const { delay } = __nccwpck_require__(3867) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { environmentSettingsObject } = __nccwpck_require__(9808) +const { fetching } = __nccwpck_require__(5404) +const { makeRequest } = __nccwpck_require__(2257) +const { webidl } = __nccwpck_require__(4195) +const { EventSourceStream } = __nccwpck_require__(1581) +const { parseMIMEType } = __nccwpck_require__(4622) +const { createFastMessageEvent } = __nccwpck_require__(4926) +const { isNetworkError } = __nccwpck_require__(5093) +const { delay } = __nccwpck_require__(5537) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { environmentSettingsObject } = __nccwpck_require__(9614) let experimentalWarned = false @@ -18737,7 +18847,7 @@ module.exports = { /***/ }), -/***/ 3867: +/***/ 5537: /***/ ((module) => { "use strict"; @@ -18782,13 +18892,13 @@ module.exports = { /***/ }), -/***/ 220: +/***/ 3682: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { ReadableStreamFrom, isBlobLike, @@ -18798,16 +18908,16 @@ const { fullyReadBody, extractMimeType, utf8DecodeBytes -} = __nccwpck_require__(9808) -const { FormData } = __nccwpck_require__(2198) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { FormData } = __nccwpck_require__(7064) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) const { Blob } = __nccwpck_require__(4573) const assert = __nccwpck_require__(4589) const { isErrored, isDisturbed } = __nccwpck_require__(7075) const { isArrayBuffer } = __nccwpck_require__(3429) -const { serializeAMimeType } = __nccwpck_require__(8828) -const { multipartFormDataParser } = __nccwpck_require__(6052) +const { serializeAMimeType } = __nccwpck_require__(4622) +const { multipartFormDataParser } = __nccwpck_require__(5670) let random try { @@ -19319,7 +19429,7 @@ module.exports = { /***/ }), -/***/ 1935: +/***/ 3169: /***/ ((module) => { "use strict"; @@ -19451,7 +19561,7 @@ module.exports = { /***/ }), -/***/ 8828: +/***/ 4622: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -20203,13 +20313,13 @@ module.exports = { /***/ }), -/***/ 125: +/***/ 3207: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConnected, kSize } = __nccwpck_require__(1675) +const { kConnected, kSize } = __nccwpck_require__(8705) class CompatWeakRef { constructor (value) { @@ -20257,15 +20367,15 @@ module.exports = function () { /***/ }), -/***/ 8250: +/***/ 4052: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Blob, File } = __nccwpck_require__(4573) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) // TODO(@KhafraDev): remove class FileLike { @@ -20391,17 +20501,17 @@ module.exports = { FileLike, isFileLike } /***/ }), -/***/ 6052: +/***/ 5670: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { utf8DecodeBytes } = __nccwpck_require__(9808) -const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(8828) -const { isFileLike } = __nccwpck_require__(8250) -const { makeEntry } = __nccwpck_require__(2198) +const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { utf8DecodeBytes } = __nccwpck_require__(9614) +const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(4622) +const { isFileLike } = __nccwpck_require__(4052) +const { makeEntry } = __nccwpck_require__(7064) const assert = __nccwpck_require__(4589) const { File: NodeFile } = __nccwpck_require__(4573) @@ -20873,17 +20983,17 @@ module.exports = { /***/ }), -/***/ 2198: +/***/ 7064: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isBlobLike, iteratorMixin } = __nccwpck_require__(9808) -const { kState } = __nccwpck_require__(2043) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { FileLike, isFileLike } = __nccwpck_require__(8250) -const { webidl } = __nccwpck_require__(613) +const { isBlobLike, iteratorMixin } = __nccwpck_require__(9614) +const { kState } = __nccwpck_require__(4701) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { FileLike, isFileLike } = __nccwpck_require__(4052) +const { webidl } = __nccwpck_require__(4195) const { File: NativeFile } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) @@ -21133,7 +21243,7 @@ module.exports = { FormData, makeEntry } /***/ }), -/***/ 5699: +/***/ 7573: /***/ ((module) => { "use strict"; @@ -21181,7 +21291,7 @@ module.exports = { /***/ }), -/***/ 6548: +/***/ 4478: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -21189,14 +21299,14 @@ module.exports = { -const { kConstruct } = __nccwpck_require__(1675) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(8705) +const { kEnumerableProperty } = __nccwpck_require__(2250) const { iteratorMixin, isValidHeaderName, isValidHeaderValue -} = __nccwpck_require__(9808) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { webidl } = __nccwpck_require__(4195) const assert = __nccwpck_require__(4589) const util = __nccwpck_require__(7975) @@ -21876,7 +21986,7 @@ module.exports = { /***/ }), -/***/ 782: +/***/ 5404: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -21890,9 +22000,9 @@ const { filterResponse, makeResponse, fromInnerResponse -} = __nccwpck_require__(2603) -const { HeadersList } = __nccwpck_require__(6548) -const { Request, cloneRequest } = __nccwpck_require__(6607) +} = __nccwpck_require__(5093) +const { HeadersList } = __nccwpck_require__(4478) +const { Request, cloneRequest } = __nccwpck_require__(2257) const zlib = __nccwpck_require__(8522) const { bytesMatch, @@ -21928,23 +22038,23 @@ const { buildContentRange, createInflate, extractMimeType -} = __nccwpck_require__(9808) -const { kState, kDispatcher } = __nccwpck_require__(2043) +} = __nccwpck_require__(9614) +const { kState, kDispatcher } = __nccwpck_require__(4701) const assert = __nccwpck_require__(4589) -const { safelyExtractBody, extractBody } = __nccwpck_require__(220) +const { safelyExtractBody, extractBody } = __nccwpck_require__(3682) const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const EE = __nccwpck_require__(8474) const { Readable, pipeline, finished } = __nccwpck_require__(7075) -const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(8828) -const { getGlobalDispatcher } = __nccwpck_require__(197) -const { webidl } = __nccwpck_require__(613) +const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(4622) +const { getGlobalDispatcher } = __nccwpck_require__(6759) +const { webidl } = __nccwpck_require__(4195) const { STATUS_CODES } = __nccwpck_require__(7067) const GET_OR_HEAD = ['GET', 'HEAD'] @@ -24156,7 +24266,7 @@ module.exports = { /***/ }), -/***/ 6607: +/***/ 2257: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -24164,16 +24274,16 @@ module.exports = { -const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(220) -const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(6548) -const { FinalizationRegistry } = __nccwpck_require__(125)() -const util = __nccwpck_require__(3792) +const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(3682) +const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(4478) +const { FinalizationRegistry } = __nccwpck_require__(3207)() +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { isValidHTTPToken, sameOrigin, environmentSettingsObject -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { forbiddenMethodsSet, corsSafeListedMethodsSet, @@ -24183,12 +24293,12 @@ const { requestCredentials, requestCache, requestDuplex -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util -const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474) @@ -25201,15 +25311,15 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest } /***/ }), -/***/ 2603: +/***/ 5093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(6548) -const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(220) -const util = __nccwpck_require__(3792) +const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(4478) +const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(3682) +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { kEnumerableProperty } = util const { @@ -25221,16 +25331,16 @@ const { isErrorLike, isomorphicEncode, environmentSettingsObject: relevantRealm -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { redirectStatusSet, nullBodyStatus -} = __nccwpck_require__(1935) -const { kState, kHeaders } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { FormData } = __nccwpck_require__(2198) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +} = __nccwpck_require__(3169) +const { kState, kHeaders } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { FormData } = __nccwpck_require__(7064) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { types } = __nccwpck_require__(7975) @@ -25819,7 +25929,7 @@ module.exports = { /***/ }), -/***/ 2043: +/***/ 4701: /***/ ((module) => { "use strict"; @@ -25836,7 +25946,7 @@ module.exports = { /***/ }), -/***/ 9808: +/***/ 9614: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -25844,14 +25954,14 @@ module.exports = { const { Transform } = __nccwpck_require__(7075) const zlib = __nccwpck_require__(8522) -const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1935) -const { getGlobalOrigin } = __nccwpck_require__(5699) -const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(8828) +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(3169) +const { getGlobalOrigin } = __nccwpck_require__(7573) +const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(4622) const { performance } = __nccwpck_require__(643) -const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3792) +const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(2250) const assert = __nccwpck_require__(4589) const { isUint8Array } = __nccwpck_require__(3429) -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) let supportedHashes = [] @@ -27476,7 +27586,7 @@ module.exports = { /***/ }), -/***/ 613: +/***/ 4195: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -27484,7 +27594,7 @@ module.exports = { const { types, inspect } = __nccwpck_require__(7975) const { markAsUncloneable } = __nccwpck_require__(5919) -const { toUSVString } = __nccwpck_require__(3792) +const { toUSVString } = __nccwpck_require__(2250) /** @type {import('../../../types/webidl').Webidl} */ const webidl = {} @@ -28179,7 +28289,7 @@ module.exports = { /***/ }), -/***/ 9919: +/***/ 7261: /***/ ((module) => { "use strict"; @@ -28477,7 +28587,7 @@ module.exports = { /***/ }), -/***/ 9395: +/***/ 6705: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -28487,16 +28597,16 @@ const { staticPropertyDescriptors, readOperation, fireAProgressEvent -} = __nccwpck_require__(3738) +} = __nccwpck_require__(6532) const { kState, kError, kResult, kEvents, kAborted -} = __nccwpck_require__(2913) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +} = __nccwpck_require__(9671) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class FileReader extends EventTarget { constructor () { @@ -28829,13 +28939,13 @@ module.exports = { /***/ }), -/***/ 7101: +/***/ 8731: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) const kState = Symbol('ProgressEvent state') @@ -28915,7 +29025,7 @@ module.exports = { /***/ }), -/***/ 2913: +/***/ 9671: /***/ ((module) => { "use strict"; @@ -28933,7 +29043,7 @@ module.exports = { /***/ }), -/***/ 3738: +/***/ 6532: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -28945,10 +29055,10 @@ const { kResult, kAborted, kLastProgressEventFired -} = __nccwpck_require__(2913) -const { ProgressEvent } = __nccwpck_require__(7101) -const { getEncoding } = __nccwpck_require__(9919) -const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(8828) +} = __nccwpck_require__(9671) +const { ProgressEvent } = __nccwpck_require__(8731) +const { getEncoding } = __nccwpck_require__(7261) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4622) const { types } = __nccwpck_require__(7975) const { StringDecoder } = __nccwpck_require__(3193) const { btoa } = __nccwpck_require__(4573) @@ -29332,28 +29442,28 @@ module.exports = { /***/ }), -/***/ 737: +/***/ 2379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(2512) +const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(362) const { kReadyState, kSentClose, kByteParser, kReceivedClose, kResponse -} = __nccwpck_require__(9360) -const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(4081) -const { channels } = __nccwpck_require__(7822) -const { CloseEvent } = __nccwpck_require__(8916) -const { makeRequest } = __nccwpck_require__(6607) -const { fetching } = __nccwpck_require__(782) -const { Headers, getHeadersList } = __nccwpck_require__(6548) -const { getDecodeSplit } = __nccwpck_require__(9808) -const { WebsocketFrameSend } = __nccwpck_require__(2928) +} = __nccwpck_require__(6858) +const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(343) +const { channels } = __nccwpck_require__(6692) +const { CloseEvent } = __nccwpck_require__(4926) +const { makeRequest } = __nccwpck_require__(2257) +const { fetching } = __nccwpck_require__(5404) +const { Headers, getHeadersList } = __nccwpck_require__(4478) +const { getDecodeSplit } = __nccwpck_require__(9614) +const { WebsocketFrameSend } = __nccwpck_require__(9506) /** @type {import('crypto')} */ let crypto @@ -29711,7 +29821,7 @@ module.exports = { /***/ }), -/***/ 2512: +/***/ 362: /***/ ((module) => { "use strict"; @@ -29785,15 +29895,15 @@ module.exports = { /***/ }), -/***/ 8916: +/***/ 4926: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { kConstruct } = __nccwpck_require__(1675) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { kConstruct } = __nccwpck_require__(8705) const { MessagePort } = __nccwpck_require__(5919) /** @@ -30122,13 +30232,13 @@ module.exports = { /***/ }), -/***/ 2928: +/***/ 9506: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxUnsigned16Bit } = __nccwpck_require__(2512) +const { maxUnsigned16Bit } = __nccwpck_require__(362) const BUFFER_SIZE = 16386 @@ -30226,15 +30336,15 @@ module.exports = { /***/ }), -/***/ 477: +/***/ 1087: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522) -const { isValidClientWindowBits } = __nccwpck_require__(4081) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +const { isValidClientWindowBits } = __nccwpck_require__(343) +const { MessageSizeExceededError } = __nccwpck_require__(7617) const tail = Buffer.from([0x00, 0x00, 0xff, 0xff]) const kBuffer = Symbol('kBuffer') @@ -30334,7 +30444,7 @@ module.exports = { PerMessageDeflate } /***/ }), -/***/ 148: +/***/ 4658: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -30342,9 +30452,9 @@ module.exports = { PerMessageDeflate } const { Writable } = __nccwpck_require__(7075) const assert = __nccwpck_require__(4589) -const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(2512) -const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(9360) -const { channels } = __nccwpck_require__(7822) +const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(362) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(6858) +const { channels } = __nccwpck_require__(6692) const { isValidStatusCode, isValidOpcode, @@ -30354,11 +30464,16 @@ const { isControlFrame, isTextBinaryFrame, isContinuationFrame -} = __nccwpck_require__(4081) -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { closeWebSocketConnection } = __nccwpck_require__(737) -const { PerMessageDeflate } = __nccwpck_require__(477) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +} = __nccwpck_require__(343) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { closeWebSocketConnection } = __nccwpck_require__(2379) +const { PerMessageDeflate } = __nccwpck_require__(1087) +const { MessageSizeExceededError } = __nccwpck_require__(7617) + +function failWebsocketConnectionWithCode (ws, code, reason) { + closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason)) + failWebsocketConnection(ws, reason) +} // This code was influenced by ws released under the MIT license. // Copyright (c) 2011 Einar Otto Stangvik @@ -30379,19 +30494,23 @@ class ByteParser extends Writable { /** @type {Map} */ #extensions + /** @type {number} */ + #maxFragments + /** @type {number} */ #maxPayloadSize /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions - * @param {{ maxPayloadSize?: number }} [options] + * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options] */ constructor (ws, extensions, options = {}) { super() this.ws = ws this.#extensions = extensions == null ? new Map() : extensions + this.#maxFragments = options.maxFragments ?? 0 this.#maxPayloadSize = options.maxPayloadSize ?? 0 if (this.#extensions.has('permessage-deflate')) { @@ -30415,9 +30534,9 @@ class ByteParser extends Writable { if ( this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && - this.#info.payloadLength > this.#maxPayloadSize + this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize ) { - failWebsocketConnection(this.ws, 'Payload size exceeds maximum allowed size') + failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size') return false } @@ -30582,10 +30701,12 @@ class ByteParser extends Writable { this.#state = parserStates.INFO } else { if (!this.#info.compressed) { - this.writeFragments(body) + if (!this.writeFragments(body)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -30604,14 +30725,17 @@ class ByteParser extends Writable { this.#info.fin, (error, data) => { if (error) { - failWebsocketConnection(this.ws, error.message) + const code = error instanceof MessageSizeExceededError ? 1009 : 1007 + failWebsocketConnectionWithCode(this.ws, code, error.message) return } - this.writeFragments(data) + if (!this.writeFragments(data)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -30681,8 +30805,17 @@ class ByteParser extends Writable { } writeFragments (fragment) { + if ( + this.#maxFragments > 0 && + this.#fragments.length === this.#maxFragments + ) { + failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments') + return false + } + this.#fragmentsBytes += fragment.length this.#fragments.push(fragment) + return true } consumeFragments () { @@ -30832,15 +30965,15 @@ module.exports = { /***/ }), -/***/ 5164: +/***/ 7526: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { opcodes, sendHints } = __nccwpck_require__(2512) -const FixedQueue = __nccwpck_require__(8692) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { opcodes, sendHints } = __nccwpck_require__(362) +const FixedQueue = __nccwpck_require__(894) /** @type {typeof Uint8Array} */ const FastBuffer = Buffer[Symbol.species] @@ -30944,7 +31077,7 @@ module.exports = { SendQueue } /***/ }), -/***/ 9360: +/***/ 6858: /***/ ((module) => { "use strict"; @@ -30964,17 +31097,17 @@ module.exports = { /***/ }), -/***/ 4081: +/***/ 343: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(9360) -const { states, opcodes } = __nccwpck_require__(2512) -const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(8916) +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(6858) +const { states, opcodes } = __nccwpck_require__(362) +const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(4926) const { isUtf8 } = __nccwpck_require__(4573) -const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(8828) +const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(4622) /* globals Blob */ @@ -31294,16 +31427,16 @@ module.exports = { /***/ }), -/***/ 5134: +/***/ 9480: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { environmentSettingsObject } = __nccwpck_require__(9808) -const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(2512) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { environmentSettingsObject } = __nccwpck_require__(9614) +const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(362) const { kWebSocketURL, kReadyState, @@ -31312,21 +31445,21 @@ const { kResponse, kSentClose, kByteParser -} = __nccwpck_require__(9360) +} = __nccwpck_require__(6858) const { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent -} = __nccwpck_require__(4081) -const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(737) -const { ByteParser } = __nccwpck_require__(148) -const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3792) -const { getGlobalDispatcher } = __nccwpck_require__(197) +} = __nccwpck_require__(343) +const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(2379) +const { ByteParser } = __nccwpck_require__(4658) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(2250) +const { getGlobalDispatcher } = __nccwpck_require__(6759) const { types } = __nccwpck_require__(7975) -const { ErrorEvent, CloseEvent } = __nccwpck_require__(8916) -const { SendQueue } = __nccwpck_require__(5164) +const { ErrorEvent, CloseEvent } = __nccwpck_require__(4926) +const { SendQueue } = __nccwpck_require__(7526) // https://websockets.spec.whatwg.org/#interface-definition class WebSocket extends EventTarget { @@ -31735,9 +31868,12 @@ class WebSocket extends EventTarget { // once this happens, the connection is open this[kResponse] = response - const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize + const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions + const maxFragments = webSocketOptions?.maxFragments + const maxPayloadSize = webSocketOptions?.maxPayloadSize const parser = new ByteParser(this, parsedExtensions, { + maxFragments, maxPayloadSize }) parser.on('drain', onParserDrain) @@ -32232,13 +32368,13 @@ exports.range = range; /***/ }), -/***/ 8797: +/***/ 5994: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EXPANSION_MAX = void 0; +exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0; exports.expand = expand; const balanced_match_1 = __nccwpck_require__(5192); const escSlash = '\0SLASH' + Math.random() + '\0'; @@ -32257,6 +32393,17 @@ const closePattern = /\\}/g; const commaPattern = /\\,/g; const periodPattern = /\\\./g; exports.EXPANSION_MAX = 100_000; +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +exports.EXPANSION_MAX_LENGTH = 4_000_000; function numeric(str) { return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); } @@ -32306,7 +32453,7 @@ function expand(str, options = {}) { if (!str) { return []; } - const { max = exports.EXPANSION_MAX } = options; + const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, @@ -32316,7 +32463,7 @@ function expand(str, options = {}) { if (str.slice(0, 2) === '{}') { str = '\\{\\}' + str.slice(2); } - return expand_(escapeBraces(str), max, true).map(unescapeBraces); + return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); } function embrace(str) { return '{' + str + '}'; @@ -32330,22 +32477,117 @@ function lte(i, y) { function gte(i, y) { return i >= y; } -function expand_(str, max, isTop) { - /** @type {string[]} */ - const expansions = []; - const m = (0, balanced_match_1.balanced)('{', '}', str); - if (!m) - return [str]; - // no need to expand pre, since it is guaranteed to be free of brace-sets - const pre = m.pre; - const post = m.post.length ? expand_(m.post, max, false) : ['']; - if (/\$$/.test(m.pre)) { - for (let k = 0; k < post.length && k < max; k++) { - const expansion = pre + '{' + m.body + '}' + post[k]; - expansions.push(expansion); +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +function combine(acc, pre, values, max, maxLength, dropEmpties) { + const out = []; + let length = 0; + for (let a = 0; a < acc.length; a++) { + for (let v = 0; v < values.length; v++) { + if (out.length >= max) + return out; + const expansion = acc[a] + pre + values[v]; + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. + if (dropEmpties && !expansion) + continue; + if (length + expansion.length > maxLength) + return out; + out.push(expansion); + length += expansion.length; } } - else { + return out; +} +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence(body, isAlphaSequence, max, maxLength) { + const n = body.split(/\.\./); + const N = []; + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N; + } + /* c8 ignore stop */ + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + let length = 0; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + if (length + c.length > maxLength) + break; + N.push(c); + length += c.length; + } + return N; +} +function expand_(str, max, maxLength, isTop) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + let acc = ['']; + // Bash drops empty results, but only when the *first* top-level group is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + let dropEmpties = false; + let firstGroup = true; + for (;;) { + const m = (0, balanced_match_1.balanced)('{', '}', str); + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, str, [''], max, maxLength, dropEmpties); + } + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + if (/\$$/.test(pre)) { + acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length); + firstGroup = false; + if (!m.post.length) + break; + str = m.post; + continue; + } const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); const isSequence = isNumericSequence || isAlphaSequence; @@ -32354,87 +32596,69 @@ function expand_(str, max, isTop) { // {a},b} if (m.post.match(/,(?!,).*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; - return expand_(str, max, true); + isTop = true; + continue; } - return [str]; + // Nothing here expands, so the whole remaining string is literal. + return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties); } - let n; + if (firstGroup) { + dropEmpties = isTop && !isSequence; + firstGroup = false; + } + let values; if (isSequence) { - n = m.body.split(/\.\./); + values = expandSequence(m.body, isAlphaSequence, max, maxLength); } else { - n = parseCommaParts(m.body); + let n = parseCommaParts(m.body); if (n.length === 1 && n[0] !== undefined) { // x{{a,b}}y ==> x{a}y x{b}y - n = expand_(n[0], max, false).map(embrace); + n = expand_(n[0], max, maxLength, false).map(embrace); //XXX is this necessary? Can't seem to hit it in tests. /* c8 ignore start */ if (n.length === 1) { - return post.map(p => m.pre + n[0] + p); + acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + continue; } /* c8 ignore stop */ } - } - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - let N; - if (isSequence && n[0] !== undefined && n[1] !== undefined) { - const x = numeric(n[0]); - const y = numeric(n[1]); - const width = Math.max(n[0].length, n[1].length); - let incr = n.length === 3 && n[2] !== undefined ? - Math.max(Math.abs(numeric(n[2])), 1) - : 1; - let test = lte; - const reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - const pad = n.some(isPadded); - N = []; - for (let i = x; test(i, y) && N.length < max; i += incr) { - let c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') { - c = ''; - } - } - else { - c = String(i); - if (pad) { - const need = width - c.length; - if (need > 0) { - const z = new Array(need + 1).join('0'); - if (i < 0) { - c = '-' + z + c.slice(1); - } - else { - c = z + c; - } - } - } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; } - N.push(c); - } - } - else { - N = []; - for (let j = 0; j < n.length; j++) { - N.push.apply(N, expand_(n[j], max, false)); } - } - for (let j = 0; j < N.length; j++) { - for (let k = 0; k < post.length && expansions.length < max; k++) { - const expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) { - expansions.push(expansion); + values = []; + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; } } } + acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; } - return expansions; + return acc; } //# sourceMappingURL=index.js.map @@ -33692,7 +33916,7 @@ exports.escape = escape; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; -const brace_expansion_1 = __nccwpck_require__(8797); +const brace_expansion_1 = __nccwpck_require__(5994); const assert_valid_pattern_js_1 = __nccwpck_require__(2012); const ast_js_1 = __nccwpck_require__(5492); const escape_js_1 = __nccwpck_require__(6917); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5f6faf..bdbbd68 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,7 +35,11 @@ catalogs: version: 5.9.3 overrides: - js-yaml@<=4.1.1: ^4.1.2 + axios@<1.18.0: ^1.18.0 + brace-expansion@<1.1.17: ^1.1.17 + brace-expansion@>=2.0.0 <2.1.3: ^2.1.3 + brace-expansion@>=4.0.0 <5.0.8: ^5.0.8 + js-yaml@<4.3.1: ^4.3.1 importers: @@ -777,8 +781,8 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - axios@1.16.1: - resolution: {integrity: sha512-caYkukvroVPO8KrzuJEb50Hm07KwfBZPEC3VeFHTsqWHvKTsy54hjJz9BS/cdaypROE2rH6xvm9mHX4fgWkr3A==} + axios@1.19.0: + resolution: {integrity: sha512-ht/iuYZXEjFxLH/Hkezgd7m6JKlHHXEUSneaDz8uZe1Gj5QZtCnpyDsckvAiEnT89OEbCLmnte4R4sn7P0EKFw==} babel-jest@30.4.1: resolution: {integrity: sha512-fATAbM8piYxkiXQp3RBXmZHxZVNJZAVXXfyeyCN2Tida3+qJ8ea9UxhiJ2y4fLO90ZImKt6k9FlcH2+rLkJGhw==} @@ -820,15 +824,15 @@ packages: before-after-hook@4.0.0: resolution: {integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==} - brace-expansion@1.1.15: - resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==} + brace-expansion@1.1.18: + resolution: {integrity: sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==} - brace-expansion@2.1.1: - resolution: {integrity: sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==} + brace-expansion@2.1.4: + resolution: {integrity: sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==} - brace-expansion@5.0.6: - resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} - engines: {node: 18 || 20 || >=22} + brace-expansion@5.0.9: + resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==} + engines: {node: 20 || >=22} browserslist@4.28.4: resolution: {integrity: sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw==} @@ -1308,8 +1312,8 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - js-yaml@4.2.0: - resolution: {integrity: sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==} + js-yaml@4.3.1: + resolution: {integrity: sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==} hasBin: true jsesc@3.1.0: @@ -2011,7 +2015,7 @@ snapshots: camelcase: 5.3.1 find-up: 4.1.0 get-package-type: 0.1.0 - js-yaml: 4.2.0 + js-yaml: 4.3.1 resolve-from: 5.0.0 '@istanbuljs/schema@0.1.6': {} @@ -2456,7 +2460,7 @@ snapshots: asynckit@0.4.0: {} - axios@1.16.1: + axios@1.19.0: dependencies: follow-redirects: 1.16.0 form-data: 4.0.6 @@ -2526,16 +2530,16 @@ snapshots: before-after-hook@4.0.0: {} - brace-expansion@1.1.15: + brace-expansion@1.1.18: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 - brace-expansion@2.1.1: + brace-expansion@2.1.4: dependencies: balanced-match: 1.0.2 - brace-expansion@5.0.6: + brace-expansion@5.0.9: dependencies: balanced-match: 4.0.4 @@ -3213,7 +3217,7 @@ snapshots: js-tokens@4.0.0: {} - js-yaml@4.2.0: + js-yaml@4.3.1: dependencies: argparse: 2.0.1 @@ -3267,15 +3271,15 @@ snapshots: minimatch@10.2.5: dependencies: - brace-expansion: 5.0.6 + brace-expansion: 5.0.9 minimatch@3.1.5: dependencies: - brace-expansion: 1.1.15 + brace-expansion: 1.1.18 minimatch@9.0.9: dependencies: - brace-expansion: 2.1.1 + brace-expansion: 2.1.4 minimist@1.2.8: {} @@ -3283,7 +3287,7 @@ snapshots: ms-teams-webhook@2.0.3: dependencies: - axios: 1.16.1 + axios: 1.19.0 transitivePeerDependencies: - debug - supports-color diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 95624cb..9161396 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -21,4 +21,8 @@ catalog: typescript: ^5.9.3 overrides: - js-yaml@<=4.1.1: ^4.1.2 + 'axios@<1.18.0': ^1.18.0 + 'brace-expansion@<1.1.17': ^1.1.17 + 'brace-expansion@>=2.0.0 <2.1.3': ^2.1.3 + 'brace-expansion@>=4.0.0 <5.0.8': ^5.0.8 + 'js-yaml@<4.3.1': ^4.3.1 diff --git a/pr-filter/dist/index.js b/pr-filter/dist/index.js index 6e7708c..6891adf 100644 --- a/pr-filter/dist/index.js +++ b/pr-filter/dist/index.js @@ -2398,7 +2398,7 @@ exports.getProxyAgentDispatcher = getProxyAgentDispatcher; exports.getProxyFetch = getProxyFetch; exports.getApiBaseUrl = getApiBaseUrl; const httpClient = __importStar(__nccwpck_require__(5270)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -2650,7 +2650,7 @@ const http = __importStar(__nccwpck_require__(8611)); const https = __importStar(__nccwpck_require__(5692)); const pm = __importStar(__nccwpck_require__(9154)); const tunnel = __importStar(__nccwpck_require__(2695)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -4269,34 +4269,34 @@ exports.debug = debug; // for test /***/ }), -/***/ 9280: +/***/ 4782: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Client = __nccwpck_require__(5621) -const Dispatcher = __nccwpck_require__(6307) -const Pool = __nccwpck_require__(1748) -const BalancedPool = __nccwpck_require__(9717) -const Agent = __nccwpck_require__(8717) -const ProxyAgent = __nccwpck_require__(4800) -const EnvHttpProxyAgent = __nccwpck_require__(6753) -const RetryAgent = __nccwpck_require__(6770) -const errors = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +const Client = __nccwpck_require__(8223) +const Dispatcher = __nccwpck_require__(5353) +const Pool = __nccwpck_require__(5326) +const BalancedPool = __nccwpck_require__(9159) +const Agent = __nccwpck_require__(1891) +const ProxyAgent = __nccwpck_require__(5678) +const EnvHttpProxyAgent = __nccwpck_require__(7227) +const RetryAgent = __nccwpck_require__(8792) +const errors = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { InvalidArgumentError } = errors -const api = __nccwpck_require__(9719) -const buildConnector = __nccwpck_require__(6768) -const MockClient = __nccwpck_require__(4997) -const MockAgent = __nccwpck_require__(8269) -const MockPool = __nccwpck_require__(1828) -const mockErrors = __nccwpck_require__(93) -const RetryHandler = __nccwpck_require__(2728) -const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(197) -const DecoratorHandler = __nccwpck_require__(2587) -const RedirectHandler = __nccwpck_require__(5458) -const createRedirectInterceptor = __nccwpck_require__(7780) +const api = __nccwpck_require__(497) +const buildConnector = __nccwpck_require__(5634) +const MockClient = __nccwpck_require__(3735) +const MockAgent = __nccwpck_require__(3627) +const MockPool = __nccwpck_require__(6134) +const mockErrors = __nccwpck_require__(9539) +const RetryHandler = __nccwpck_require__(8022) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(6759) +const DecoratorHandler = __nccwpck_require__(3253) +const RedirectHandler = __nccwpck_require__(9104) +const createRedirectInterceptor = __nccwpck_require__(5914) Object.assign(Dispatcher.prototype, api) @@ -4314,10 +4314,10 @@ module.exports.DecoratorHandler = DecoratorHandler module.exports.RedirectHandler = RedirectHandler module.exports.createRedirectInterceptor = createRedirectInterceptor module.exports.interceptors = { - redirect: __nccwpck_require__(7594), - retry: __nccwpck_require__(9722), - dump: __nccwpck_require__(4972), - dns: __nccwpck_require__(4411) + redirect: __nccwpck_require__(2524), + retry: __nccwpck_require__(2644), + dump: __nccwpck_require__(6141), + dns: __nccwpck_require__(9765) } module.exports.buildConnector = buildConnector @@ -4379,7 +4379,7 @@ function makeDispatcher (fn) { module.exports.setGlobalDispatcher = setGlobalDispatcher module.exports.getGlobalDispatcher = getGlobalDispatcher -const fetchImpl = (__nccwpck_require__(782).fetch) +const fetchImpl = (__nccwpck_require__(5404).fetch) module.exports.fetch = async function fetch (init, options = undefined) { try { return await fetchImpl(init, options) @@ -4391,39 +4391,39 @@ module.exports.fetch = async function fetch (init, options = undefined) { throw err } } -module.exports.Headers = __nccwpck_require__(6548).Headers -module.exports.Response = __nccwpck_require__(2603).Response -module.exports.Request = __nccwpck_require__(6607).Request -module.exports.FormData = __nccwpck_require__(2198).FormData +module.exports.Headers = __nccwpck_require__(4478).Headers +module.exports.Response = __nccwpck_require__(5093).Response +module.exports.Request = __nccwpck_require__(2257).Request +module.exports.FormData = __nccwpck_require__(7064).FormData module.exports.File = globalThis.File ?? (__nccwpck_require__(4573).File) -module.exports.FileReader = __nccwpck_require__(9395).FileReader +module.exports.FileReader = __nccwpck_require__(6705).FileReader -const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(5699) +const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(7573) module.exports.setGlobalOrigin = setGlobalOrigin module.exports.getGlobalOrigin = getGlobalOrigin -const { CacheStorage } = __nccwpck_require__(8733) -const { kConstruct } = __nccwpck_require__(2045) +const { CacheStorage } = __nccwpck_require__(2363) +const { kConstruct } = __nccwpck_require__(4527) // Cache & CacheStorage are tightly coupled with fetch. Even if it may run // in an older version of Node, it doesn't have any use without fetch. module.exports.caches = new CacheStorage(kConstruct) -const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1973) +const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(6783) module.exports.deleteCookie = deleteCookie module.exports.getCookies = getCookies module.exports.getSetCookies = getSetCookies module.exports.setCookie = setCookie -const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(8828) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4622) module.exports.parseMIMEType = parseMIMEType module.exports.serializeAMimeType = serializeAMimeType -const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(8916) -module.exports.WebSocket = __nccwpck_require__(5134).WebSocket +const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(4926) +module.exports.WebSocket = __nccwpck_require__(9480).WebSocket module.exports.CloseEvent = CloseEvent module.exports.ErrorEvent = ErrorEvent module.exports.MessageEvent = MessageEvent @@ -4439,18 +4439,18 @@ module.exports.MockPool = MockPool module.exports.MockAgent = MockAgent module.exports.mockErrors = mockErrors -const { EventSource } = __nccwpck_require__(4886) +const { EventSource } = __nccwpck_require__(5768) module.exports.EventSource = EventSource /***/ }), -/***/ 1006: +/***/ 6720: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { addAbortListener } = __nccwpck_require__(3792) -const { RequestAbortedError } = __nccwpck_require__(9715) +const { addAbortListener } = __nccwpck_require__(2250) +const { RequestAbortedError } = __nccwpck_require__(7617) const kListener = Symbol('kListener') const kSignal = Symbol('kSignal') @@ -4510,7 +4510,7 @@ module.exports = { /***/ }), -/***/ 2772: +/***/ 6958: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4518,9 +4518,9 @@ module.exports = { const assert = __nccwpck_require__(4589) const { AsyncResource } = __nccwpck_require__(6698) -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class ConnectHandler extends AsyncResource { constructor (opts, callback) { @@ -4626,7 +4626,7 @@ module.exports = connect /***/ }), -/***/ 2846: +/***/ 8084: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4641,10 +4641,10 @@ const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) const kResume = Symbol('resume') @@ -4885,17 +4885,17 @@ module.exports = pipeline /***/ }), -/***/ 8875: +/***/ 353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { Readable } = __nccwpck_require__(3159) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { Readable } = __nccwpck_require__(105) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) class RequestHandler extends AsyncResource { @@ -5107,7 +5107,7 @@ module.exports.RequestHandler = RequestHandler /***/ }), -/***/ 9560: +/***/ 7010: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -5115,11 +5115,11 @@ module.exports.RequestHandler = RequestHandler const assert = __nccwpck_require__(4589) const { finished, PassThrough } = __nccwpck_require__(7075) -const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { @@ -5335,16 +5335,16 @@ module.exports = stream /***/ }), -/***/ 6538: +/***/ 7312: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) const { AsyncResource } = __nccwpck_require__(6698) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) class UpgradeHandler extends AsyncResource { @@ -5451,22 +5451,22 @@ module.exports = upgrade /***/ }), -/***/ 9719: +/***/ 497: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports.request = __nccwpck_require__(8875) -module.exports.stream = __nccwpck_require__(9560) -module.exports.pipeline = __nccwpck_require__(2846) -module.exports.upgrade = __nccwpck_require__(6538) -module.exports.connect = __nccwpck_require__(2772) +module.exports.request = __nccwpck_require__(353) +module.exports.stream = __nccwpck_require__(7010) +module.exports.pipeline = __nccwpck_require__(8084) +module.exports.upgrade = __nccwpck_require__(7312) +module.exports.connect = __nccwpck_require__(6958) /***/ }), -/***/ 3159: +/***/ 105: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -5476,9 +5476,9 @@ module.exports.connect = __nccwpck_require__(2772) const assert = __nccwpck_require__(4589) const { Readable } = __nccwpck_require__(7075) -const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { ReadableStreamFrom } = __nccwpck_require__(3792) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { ReadableStreamFrom } = __nccwpck_require__(2250) const kConsume = Symbol('kConsume') const kReading = Symbol('kReading') @@ -5859,15 +5859,15 @@ module.exports = { Readable: BodyReadable, chunksDecode } /***/ }), -/***/ 343: +/***/ 1337: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) const { ResponseStatusCodeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) -const { chunksDecode } = __nccwpck_require__(3159) +const { chunksDecode } = __nccwpck_require__(105) const CHUNK_LIMIT = 128 * 1024 async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { @@ -5959,7 +5959,7 @@ module.exports = { /***/ }), -/***/ 6768: +/***/ 5634: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -5967,9 +5967,9 @@ module.exports = { const net = __nccwpck_require__(7030) const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(9715) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(7617) +const timers = __nccwpck_require__(2841) function noop () {} @@ -6207,7 +6207,7 @@ module.exports = buildConnector /***/ }), -/***/ 2239: +/***/ 885: /***/ ((module) => { "use strict"; @@ -6333,7 +6333,7 @@ module.exports = { /***/ }), -/***/ 7822: +/***/ 6692: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -6543,7 +6543,7 @@ module.exports = { /***/ }), -/***/ 9715: +/***/ 7617: /***/ ((module) => { "use strict"; @@ -6976,7 +6976,7 @@ module.exports = { /***/ }), -/***/ 8655: +/***/ 7533: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -6985,7 +6985,7 @@ module.exports = { const { InvalidArgumentError, NotSupportedError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const assert = __nccwpck_require__(4589) const { isValidHTTPToken, @@ -7000,9 +7000,9 @@ const { validateHandler, getServerName, normalizedMethodRecords -} = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) +} = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) // Verifies that a given path is valid does not contain control chars \x00 to \x20 const invalidPathRegex = /[^\u0021-\u00ff]/ @@ -7389,7 +7389,7 @@ module.exports = Request /***/ }), -/***/ 1675: +/***/ 8705: /***/ ((module) => { module.exports = { @@ -7463,7 +7463,7 @@ module.exports = { /***/ }), -/***/ 4184: +/***/ 8174: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -7472,7 +7472,7 @@ module.exports = { const { wellknownHeaderNames, headerNameLowerCasedRecord -} = __nccwpck_require__(2239) +} = __nccwpck_require__(885) class TstNode { /** @type {any} */ @@ -7623,14 +7623,14 @@ module.exports = { /***/ }), -/***/ 3792: +/***/ 2250: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(1675) +const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(8705) const { IncomingMessage } = __nccwpck_require__(7067) const stream = __nccwpck_require__(7075) const net = __nccwpck_require__(7030) @@ -7638,9 +7638,9 @@ const { Blob } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) const { stringify } = __nccwpck_require__(1792) const { EventEmitter: EE } = __nccwpck_require__(8474) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) -const { tree } = __nccwpck_require__(4184) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) +const { tree } = __nccwpck_require__(8174) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) @@ -8350,19 +8350,19 @@ module.exports = { /***/ }), -/***/ 8717: +/***/ 1891: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) -const DispatcherBase = __nccwpck_require__(9921) -const Pool = __nccwpck_require__(1748) -const Client = __nccwpck_require__(5621) -const util = __nccwpck_require__(3792) -const createRedirectInterceptor = __nccwpck_require__(7780) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) +const DispatcherBase = __nccwpck_require__(2403) +const Pool = __nccwpck_require__(5326) +const Client = __nccwpck_require__(8223) +const util = __nccwpck_require__(2250) +const createRedirectInterceptor = __nccwpck_require__(5914) const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') @@ -8380,7 +8380,6 @@ function defaultFactory (origin, opts) { class Agent extends DispatcherBase { constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } @@ -8488,7 +8487,7 @@ module.exports = Agent /***/ }), -/***/ 9717: +/***/ 9159: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -8497,7 +8496,7 @@ module.exports = Agent const { BalancedPoolMissingUpstreamError, InvalidArgumentError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { PoolBase, kClients, @@ -8505,10 +8504,10 @@ const { kAddClient, kRemoveClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Pool = __nccwpck_require__(1748) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const { parseOrigin } = __nccwpck_require__(3792) +} = __nccwpck_require__(7262) +const Pool = __nccwpck_require__(5326) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const { parseOrigin } = __nccwpck_require__(2250) const kFactory = Symbol('factory') const kOptions = Symbol('options') @@ -8705,7 +8704,7 @@ module.exports = BalancedPool /***/ }), -/***/ 2285: +/***/ 8875: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -8714,9 +8713,9 @@ module.exports = BalancedPool /* global WebAssembly */ const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const timers = __nccwpck_require__(2841) const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, @@ -8728,7 +8727,7 @@ const { BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -8761,22 +8760,25 @@ const { kOnError, kResume, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) -const constants = __nccwpck_require__(9368) +const constants = __nccwpck_require__(6882) const EMPTY_BUF = Buffer.alloc(0) const FastBuffer = Buffer[Symbol.species] const addListener = util.addListener const removeAllListeners = util.removeAllListeners +const kIdleSocketValidation = Symbol('kIdleSocketValidation') +const kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout') +const kSocketUsed = Symbol('kSocketUsed') let extractBody async function lazyllhttp () { - const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(798) : undefined + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(4728) : undefined let mod try { - mod = await WebAssembly.compile(__nccwpck_require__(4682)) + mod = await WebAssembly.compile(__nccwpck_require__(5984)) } catch (e) { /* istanbul ignore next */ @@ -8784,7 +8786,7 @@ async function lazyllhttp () { // being enabled, but the occurring of this other error // * https://github.com/emscripten-core/emscripten/issues/11495 // got me to remove that check to avoid breaking Node 12. - mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(798)) + mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(4728)) } return await WebAssembly.instantiate(mod, { @@ -8990,29 +8992,71 @@ class Parser { const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr - if (ret === constants.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(data.slice(offset)) - } else if (ret === constants.ERROR.PAUSED) { - this.paused = true - socket.unshift(data.slice(offset)) - } else if (ret !== constants.ERROR.OK) { - const ptr = llhttp.llhttp_get_error_reason(this.ptr) - let message = '' - /* istanbul ignore else: difficult to make a test case for */ - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) - message = - 'Response does not match the HTTP/1.1 protocol (' + - Buffer.from(llhttp.memory.buffer, ptr, len).toString() + - ')' - } - throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + if (ret !== constants.ERROR.OK) { + const body = data.subarray(offset) + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(body) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(body) + } else { + throw this.createError(ret, body) + } } } catch (err) { util.destroy(socket, err) } } + finish () { + assert(currentParser === null) + assert(this.ptr != null) + assert(!this.paused) + + const { llhttp } = this + + let ret + + try { + currentParser = this + ret = llhttp.llhttp_finish(this.ptr) + } finally { + currentParser = null + } + + if (ret === constants.ERROR.OK) { + return null + } + + if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { + this.paused = true + return null + } + + return this.createError(ret, EMPTY_BUF) + } + + createError (ret, data) { + const { llhttp, contentLength, bytesRead } = this + + if (contentLength && bytesRead !== parseInt(contentLength, 10)) { + return new ResponseContentLengthMismatchError() + } + + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + + return new HTTPParserError(message, constants.ERROR[ret], data) + } + destroy () { assert(this.ptr != null) assert(currentParser == null) @@ -9040,6 +9084,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] if (!request) { return -1 @@ -9143,6 +9192,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] /* istanbul ignore next: difficult to make a test case for */ @@ -9316,6 +9370,7 @@ class Parser { request.onComplete(headers) client[kQueue][client[kRunningIdx]++] = null + socket[kSocketUsed] = true if (socket[kWriting]) { assert(client[kRunning] === 0) @@ -9374,6 +9429,9 @@ async function connectH1 (client, socket) { socket[kWriting] = false socket[kReset] = false socket[kBlocking] = false + socket[kIdleSocketValidation] = 0 + socket[kIdleSocketValidationTimeout] = null + socket[kSocketUsed] = false socket[kParser] = new Parser(client, socket, llhttpInstance) addListener(socket, 'error', function (err) { @@ -9384,8 +9442,11 @@ async function connectH1 (client, socket) { // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded // to the user. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so for as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + this[kError] = parserErr + this[kClient][kOnError](parserErr) + } return } @@ -9404,8 +9465,10 @@ async function connectH1 (client, socket) { const parser = this[kParser] if (parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + util.destroy(this, parserErr) + } return } @@ -9415,10 +9478,11 @@ async function connectH1 (client, socket) { const client = this[kClient] const parser = this[kParser] + clearIdleSocketValidation(this) + if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + this[kError] = parser.finish() || this[kError] } this[kParser].destroy() @@ -9481,7 +9545,7 @@ async function connectH1 (client, socket) { return socket.destroyed }, busy (request) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) { return true } @@ -9519,6 +9583,31 @@ async function connectH1 (client, socket) { } } +function clearIdleSocketValidation (socket) { + if (socket[kIdleSocketValidationTimeout]) { + clearTimeout(socket[kIdleSocketValidationTimeout]) + socket[kIdleSocketValidationTimeout] = null + } + + socket[kIdleSocketValidation] = 0 +} + +function scheduleIdleSocketValidation (client, socket) { + socket[kIdleSocketValidation] = 1 + socket[kIdleSocketValidationTimeout] = setTimeout(() => { + socket[kIdleSocketValidationTimeout] = null + socket[kIdleSocketValidation] = 2 + + if (client[kSocket] === socket && !socket.destroyed) { + client[kResume]() + } + }, 0) + socket[kIdleSocketValidationTimeout].unref?.() +} + +/** + * @param {import('./client.js')} client + */ function resumeH1 (client) { const socket = client[kSocket] @@ -9533,6 +9622,32 @@ function resumeH1 (client) { socket[kNoRef] = false } + if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) { + if (socket[kIdleSocketValidation] === 0) { + scheduleIdleSocketValidation(client, socket) + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + + if (socket[kIdleSocketValidation] === 1) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + } + + if (client[kRunning] === 0) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + } + if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE) @@ -9579,7 +9694,7 @@ function writeH1 (client, request) { if (util.isFormDataLike(body)) { if (!extractBody) { - extractBody = (__nccwpck_require__(220).extractBody) + extractBody = (__nccwpck_require__(3682).extractBody) } const [bodyStream, contentType] = extractBody(body) @@ -9626,6 +9741,7 @@ function writeH1 (client, request) { } const socket = client[kSocket] + clearIdleSocketValidation(socket) const abort = (err) => { if (request.aborted || request.completed) { @@ -10083,7 +10199,7 @@ module.exports = connectH1 /***/ }), -/***/ 4164: +/***/ 7662: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10091,13 +10207,13 @@ module.exports = connectH1 const assert = __nccwpck_require__(4589) const { pipeline } = __nccwpck_require__(7075) -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -10116,7 +10232,7 @@ const { kResume, kSize, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) const kOpenStreams = Symbol('open streams') @@ -10475,7 +10591,7 @@ function writeH2 (client, request) { let contentLength = util.bodyLength(body) if (util.isFormDataLike(body)) { - extractBody ??= (__nccwpck_require__(220).extractBody) + extractBody ??= (__nccwpck_require__(3682).extractBody) const [bodyStream, contentType] = extractBody(body) headers['content-type'] = contentType @@ -10835,7 +10951,7 @@ module.exports = connectH2 /***/ }), -/***/ 5621: +/***/ 8223: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10846,16 +10962,16 @@ module.exports = connectH2 const assert = __nccwpck_require__(4589) const net = __nccwpck_require__(7030) const http = __nccwpck_require__(7067) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const Request = __nccwpck_require__(8655) -const DispatcherBase = __nccwpck_require__(9921) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const Request = __nccwpck_require__(7533) +const DispatcherBase = __nccwpck_require__(2403) const { InvalidArgumentError, InformationalError, ClientDestroyedError -} = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) const { kUrl, kServerName, @@ -10897,9 +11013,9 @@ const { kHTTPContext, kMaxConcurrentStreams, kResume -} = __nccwpck_require__(1675) -const connectH1 = __nccwpck_require__(2285) -const connectH2 = __nccwpck_require__(4164) +} = __nccwpck_require__(8705) +const connectH1 = __nccwpck_require__(8875) +const connectH2 = __nccwpck_require__(7662) let deprecatedInterceptorWarned = false const kClosedResolve = Symbol('kClosedResolve') @@ -11206,7 +11322,7 @@ class Client extends DispatcherBase { } } -const createRedirectInterceptor = __nccwpck_require__(7780) +const createRedirectInterceptor = __nccwpck_require__(5914) function onError (client, err) { if ( @@ -11466,19 +11582,19 @@ module.exports = Client /***/ }), -/***/ 9921: +/***/ 2403: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) +const Dispatcher = __nccwpck_require__(5353) const { ClientDestroyedError, ClientClosedError, InvalidArgumentError -} = __nccwpck_require__(9715) -const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(1675) +} = __nccwpck_require__(7617) +const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(8705) const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') @@ -11498,6 +11614,7 @@ class DispatcherBase extends Dispatcher { get webSocketOptions () { return { + maxFragments: this[kWebSocketOptions].maxFragments ?? 131072, maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 } } @@ -11672,7 +11789,7 @@ module.exports = DispatcherBase /***/ }), -/***/ 6307: +/***/ 5353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -11745,16 +11862,16 @@ module.exports = Dispatcher /***/ }), -/***/ 6753: +/***/ 7227: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(1675) -const ProxyAgent = __nccwpck_require__(4800) -const Agent = __nccwpck_require__(8717) +const DispatcherBase = __nccwpck_require__(2403) +const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(8705) +const ProxyAgent = __nccwpck_require__(5678) +const Agent = __nccwpck_require__(1891) const DEFAULT_PORTS = { 'http:': 80, @@ -11913,7 +12030,7 @@ module.exports = EnvHttpProxyAgent /***/ }), -/***/ 8692: +/***/ 894: /***/ ((module) => { "use strict"; @@ -12038,16 +12155,16 @@ module.exports = class FixedQueue { /***/ }), -/***/ 2192: +/***/ 7262: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const FixedQueue = __nccwpck_require__(8692) -const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(1675) -const PoolStats = __nccwpck_require__(206) +const DispatcherBase = __nccwpck_require__(2403) +const FixedQueue = __nccwpck_require__(894) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(8705) +const PoolStats = __nccwpck_require__(3264) const kClients = Symbol('clients') const kNeedDrain = Symbol('needDrain') @@ -12240,10 +12357,10 @@ module.exports = { /***/ }), -/***/ 206: +/***/ 3264: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(1675) +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(8705) const kPool = Symbol('pool') class PoolStats { @@ -12281,7 +12398,7 @@ module.exports = PoolStats /***/ }), -/***/ 1748: +/***/ 5326: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -12293,14 +12410,14 @@ const { kNeedDrain, kAddClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Client = __nccwpck_require__(5621) +} = __nccwpck_require__(7262) +const Client = __nccwpck_require__(8223) const { InvalidArgumentError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const buildConnector = __nccwpck_require__(5634) const kOptions = Symbol('options') const kConnections = Symbol('connections') @@ -12396,20 +12513,20 @@ module.exports = Pool /***/ }), -/***/ 4800: +/***/ 5678: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) +const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) const { URL } = __nccwpck_require__(3136) -const Agent = __nccwpck_require__(8717) -const Pool = __nccwpck_require__(1748) -const DispatcherBase = __nccwpck_require__(9921) -const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) -const Client = __nccwpck_require__(5621) +const Agent = __nccwpck_require__(1891) +const Pool = __nccwpck_require__(5326) +const DispatcherBase = __nccwpck_require__(2403) +const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) +const Client = __nccwpck_require__(8223) const kAgent = Symbol('proxy agent') const kClient = Symbol('proxy client') @@ -12678,14 +12795,14 @@ module.exports = ProxyAgent /***/ }), -/***/ 6770: +/***/ 8792: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) -const RetryHandler = __nccwpck_require__(2728) +const Dispatcher = __nccwpck_require__(5353) +const RetryHandler = __nccwpck_require__(8022) class RetryAgent extends Dispatcher { #agent = null @@ -12721,7 +12838,7 @@ module.exports = RetryAgent /***/ }), -/***/ 197: +/***/ 6759: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -12730,8 +12847,8 @@ module.exports = RetryAgent // We include a version number for the Dispatcher API. In case of breaking changes, // this version number must be increased to avoid conflicts. const globalDispatcher = Symbol.for('undici.globalDispatcher.1') -const { InvalidArgumentError } = __nccwpck_require__(9715) -const Agent = __nccwpck_require__(8717) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const Agent = __nccwpck_require__(1891) if (getGlobalDispatcher() === undefined) { setGlobalDispatcher(new Agent()) @@ -12761,7 +12878,7 @@ module.exports = { /***/ }), -/***/ 2587: +/***/ 3253: /***/ ((module) => { "use strict"; @@ -12813,16 +12930,16 @@ module.exports = class DecoratorHandler { /***/ }), -/***/ 5458: +/***/ 9104: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { kBodyUsed } = __nccwpck_require__(1675) +const util = __nccwpck_require__(2250) +const { kBodyUsed } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) -const { InvalidArgumentError } = __nccwpck_require__(9715) +const { InvalidArgumentError } = __nccwpck_require__(7617) const EE = __nccwpck_require__(8474) const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] @@ -13053,21 +13170,21 @@ module.exports = RedirectHandler /***/ }), -/***/ 2728: +/***/ 8022: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kRetryHandlerDefaultRetry } = __nccwpck_require__(1675) -const { RequestRetryError } = __nccwpck_require__(9715) +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(8705) +const { RequestRetryError } = __nccwpck_require__(7617) const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody -} = __nccwpck_require__(3792) +} = __nccwpck_require__(2250) function calculateRetryAfterHeader (retryAfter) { const current = Date.now() @@ -13435,15 +13552,15 @@ module.exports = RetryHandler /***/ }), -/***/ 4411: +/***/ 9765: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { isIP } = __nccwpck_require__(7030) const { lookup } = __nccwpck_require__(610) -const DecoratorHandler = __nccwpck_require__(2587) -const { InvalidArgumentError, InformationalError } = __nccwpck_require__(9715) +const DecoratorHandler = __nccwpck_require__(3253) +const { InvalidArgumentError, InformationalError } = __nccwpck_require__(7617) const maxInt = Math.pow(2, 31) - 1 class DNSInstance { @@ -13818,15 +13935,15 @@ module.exports = interceptorOpts => { /***/ }), -/***/ 4972: +/***/ 6141: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const DecoratorHandler = __nccwpck_require__(2587) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const DecoratorHandler = __nccwpck_require__(3253) class DumpHandler extends DecoratorHandler { #maxSize = 1024 * 1024 @@ -13949,13 +14066,13 @@ module.exports = createDumpInterceptor /***/ }), -/***/ 7780: +/***/ 5914: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { @@ -13978,12 +14095,12 @@ module.exports = createRedirectInterceptor /***/ }), -/***/ 7594: +/***/ 2524: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) module.exports = opts => { const globalMaxRedirections = opts?.maxRedirections @@ -14010,12 +14127,12 @@ module.exports = opts => { /***/ }), -/***/ 9722: +/***/ 2644: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RetryHandler = __nccwpck_require__(2728) +const RetryHandler = __nccwpck_require__(8022) module.exports = globalOpts => { return dispatch => { @@ -14037,14 +14154,14 @@ module.exports = globalOpts => { /***/ }), -/***/ 9368: +/***/ 6882: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; -const utils_1 = __nccwpck_require__(2316); +const utils_1 = __nccwpck_require__(2234); // C headers var ERROR; (function (ERROR) { @@ -14322,7 +14439,7 @@ exports.SPECIAL_HEADERS = { /***/ }), -/***/ 798: +/***/ 4728: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -14335,7 +14452,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 4682: +/***/ 5984: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -14348,7 +14465,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 2316: +/***/ 2234: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -14370,14 +14487,14 @@ exports.enumToMap = enumToMap; /***/ }), -/***/ 8269: +/***/ 3627: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kClients } = __nccwpck_require__(1675) -const Agent = __nccwpck_require__(8717) +const { kClients } = __nccwpck_require__(8705) +const Agent = __nccwpck_require__(1891) const { kAgent, kMockAgentSet, @@ -14388,14 +14505,14 @@ const { kGetNetConnect, kOptions, kFactory -} = __nccwpck_require__(4093) -const MockClient = __nccwpck_require__(4997) -const MockPool = __nccwpck_require__(1828) -const { matchValue, buildMockOptions } = __nccwpck_require__(3589) -const { InvalidArgumentError, UndiciError } = __nccwpck_require__(9715) -const Dispatcher = __nccwpck_require__(6307) -const Pluralizer = __nccwpck_require__(5097) -const PendingInterceptorsFormatter = __nccwpck_require__(9758) +} = __nccwpck_require__(4251) +const MockClient = __nccwpck_require__(3735) +const MockPool = __nccwpck_require__(6134) +const { matchValue, buildMockOptions } = __nccwpck_require__(6031) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(7617) +const Dispatcher = __nccwpck_require__(5353) +const Pluralizer = __nccwpck_require__(1591) +const PendingInterceptorsFormatter = __nccwpck_require__(9236) class MockAgent extends Dispatcher { constructor (opts) { @@ -14538,15 +14655,15 @@ module.exports = MockAgent /***/ }), -/***/ 4997: +/***/ 3735: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Client = __nccwpck_require__(5621) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Client = __nccwpck_require__(8223) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -14555,10 +14672,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockClient provides an API that extends the Client to influence the mockDispatches. @@ -14605,13 +14722,13 @@ module.exports = MockClient /***/ }), -/***/ 93: +/***/ 9539: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { UndiciError } = __nccwpck_require__(9715) +const { UndiciError } = __nccwpck_require__(7617) const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED') @@ -14641,13 +14758,13 @@ module.exports = { /***/ }), -/***/ 6039: +/***/ 3969: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3589) +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kDispatchKey, @@ -14655,9 +14772,9 @@ const { kDefaultTrailers, kContentLength, kMockDispatch -} = __nccwpck_require__(4093) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { buildURL } = __nccwpck_require__(2250) /** * Defines the scope API for an interceptor reply @@ -14856,15 +14973,15 @@ module.exports.MockScope = MockScope /***/ }), -/***/ 1828: +/***/ 6134: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Pool = __nccwpck_require__(1748) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Pool = __nccwpck_require__(5326) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -14873,10 +14990,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockPool provides an API that extends the Pool to influence the mockDispatches. @@ -14923,7 +15040,7 @@ module.exports = MockPool /***/ }), -/***/ 4093: +/***/ 4251: /***/ ((module) => { "use strict"; @@ -14954,21 +15071,21 @@ module.exports = { /***/ }), -/***/ 3589: +/***/ 6031: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { MockNotMatchedError } = __nccwpck_require__(93) +const { MockNotMatchedError } = __nccwpck_require__(9539) const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect -} = __nccwpck_require__(4093) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { buildURL } = __nccwpck_require__(2250) const { STATUS_CODES } = __nccwpck_require__(7067) const { types: { @@ -15329,7 +15446,7 @@ module.exports = { /***/ }), -/***/ 9758: +/***/ 9236: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -15380,7 +15497,7 @@ module.exports = class PendingInterceptorsFormatter { /***/ }), -/***/ 5097: +/***/ 1591: /***/ ((module) => { "use strict"; @@ -15417,7 +15534,7 @@ module.exports = class Pluralizer { /***/ }), -/***/ 1915: +/***/ 2841: /***/ ((module) => { "use strict"; @@ -15848,21 +15965,21 @@ module.exports = { /***/ }), -/***/ 5714: +/***/ 9556: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { urlEquals, getFieldValues } = __nccwpck_require__(8094) -const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3792) -const { webidl } = __nccwpck_require__(613) -const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(2603) -const { Request, fromInnerRequest } = __nccwpck_require__(6607) -const { kState } = __nccwpck_require__(2043) -const { fetching } = __nccwpck_require__(782) -const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9808) +const { kConstruct } = __nccwpck_require__(4527) +const { urlEquals, getFieldValues } = __nccwpck_require__(7900) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(2250) +const { webidl } = __nccwpck_require__(4195) +const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(5093) +const { Request, fromInnerRequest } = __nccwpck_require__(2257) +const { kState } = __nccwpck_require__(4701) +const { fetching } = __nccwpck_require__(5404) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9614) const assert = __nccwpck_require__(4589) /** @@ -16715,16 +16832,16 @@ module.exports = { /***/ }), -/***/ 8733: +/***/ 2363: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { Cache } = __nccwpck_require__(5714) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(4527) +const { Cache } = __nccwpck_require__(9556) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class CacheStorage { /** @@ -16875,28 +16992,28 @@ module.exports = { /***/ }), -/***/ 2045: +/***/ 4527: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - kConstruct: (__nccwpck_require__(1675).kConstruct) + kConstruct: (__nccwpck_require__(8705).kConstruct) } /***/ }), -/***/ 8094: +/***/ 7900: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { URLSerializer } = __nccwpck_require__(8828) -const { isValidHeaderName } = __nccwpck_require__(9808) +const { URLSerializer } = __nccwpck_require__(4622) +const { isValidHeaderName } = __nccwpck_require__(9614) /** * @see https://url.spec.whatwg.org/#concept-url-equals @@ -16941,7 +17058,7 @@ module.exports = { /***/ }), -/***/ 924: +/***/ 8498: /***/ ((module) => { "use strict"; @@ -16961,16 +17078,16 @@ module.exports = { /***/ }), -/***/ 1973: +/***/ 6783: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { parseSetCookie } = __nccwpck_require__(3498) -const { stringify } = __nccwpck_require__(4533) -const { webidl } = __nccwpck_require__(613) -const { Headers } = __nccwpck_require__(6548) +const { parseSetCookie } = __nccwpck_require__(9032) +const { stringify } = __nccwpck_require__(6095) +const { webidl } = __nccwpck_require__(4195) +const { Headers } = __nccwpck_require__(4478) /** * @typedef {Object} Cookie @@ -17153,15 +17270,15 @@ module.exports = { /***/ }), -/***/ 3498: +/***/ 9032: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(924) -const { isCTLExcludingHtab } = __nccwpck_require__(4533) -const { collectASequenceOfCodePointsFast } = __nccwpck_require__(8828) +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(8498) +const { isCTLExcludingHtab } = __nccwpck_require__(6095) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4622) const assert = __nccwpck_require__(4589) /** @@ -17434,32 +17551,25 @@ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) // If the attribute-name case-insensitively matches the string // "SameSite", the user agent MUST process the cookie-av as follows: - // 1. Let enforcement be "Default". - let enforcement = 'Default' - const attributeValueLowercase = attributeValue.toLowerCase() - // 2. If cookie-av's attribute-value is a case-insensitive match for - // "None", set enforcement to "None". - if (attributeValueLowercase.includes('none')) { - enforcement = 'None' - } - // 3. If cookie-av's attribute-value is a case-insensitive match for - // "Strict", set enforcement to "Strict". - if (attributeValueLowercase.includes('strict')) { - enforcement = 'Strict' + // 1. If cookie-av's attribute-value is a case-insensitive match for + // "None", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "None". + if (attributeValueLowercase === 'none') { + cookieAttributeList.sameSite = 'None' + } else if (attributeValueLowercase === 'strict') { + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", append an attribute to the cookie-attribute-list with + // an attribute-name of "SameSite" and an attribute-value of + // "Strict". + cookieAttributeList.sameSite = 'Strict' + } else if (attributeValueLowercase === 'lax') { + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "Lax". + cookieAttributeList.sameSite = 'Lax' } - - // 4. If cookie-av's attribute-value is a case-insensitive match for - // "Lax", set enforcement to "Lax". - if (attributeValueLowercase.includes('lax')) { - enforcement = 'Lax' - } - - // 5. Append an attribute to the cookie-attribute-list with an - // attribute-name of "SameSite" and an attribute-value of - // enforcement. - cookieAttributeList.sameSite = enforcement } else { cookieAttributeList.unparsed ??= [] @@ -17478,7 +17588,7 @@ module.exports = { /***/ }), -/***/ 4533: +/***/ 6095: /***/ ((module) => { "use strict"; @@ -17768,13 +17878,13 @@ module.exports = { /***/ }), -/***/ 8735: +/***/ 1581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Transform } = __nccwpck_require__(7075) -const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(3867) +const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5537) /** * @type {number[]} BOM @@ -18174,23 +18284,23 @@ module.exports = { /***/ }), -/***/ 4886: +/***/ 5768: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { pipeline } = __nccwpck_require__(7075) -const { fetching } = __nccwpck_require__(782) -const { makeRequest } = __nccwpck_require__(6607) -const { webidl } = __nccwpck_require__(613) -const { EventSourceStream } = __nccwpck_require__(8735) -const { parseMIMEType } = __nccwpck_require__(8828) -const { createFastMessageEvent } = __nccwpck_require__(8916) -const { isNetworkError } = __nccwpck_require__(2603) -const { delay } = __nccwpck_require__(3867) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { environmentSettingsObject } = __nccwpck_require__(9808) +const { fetching } = __nccwpck_require__(5404) +const { makeRequest } = __nccwpck_require__(2257) +const { webidl } = __nccwpck_require__(4195) +const { EventSourceStream } = __nccwpck_require__(1581) +const { parseMIMEType } = __nccwpck_require__(4622) +const { createFastMessageEvent } = __nccwpck_require__(4926) +const { isNetworkError } = __nccwpck_require__(5093) +const { delay } = __nccwpck_require__(5537) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { environmentSettingsObject } = __nccwpck_require__(9614) let experimentalWarned = false @@ -18662,7 +18772,7 @@ module.exports = { /***/ }), -/***/ 3867: +/***/ 5537: /***/ ((module) => { "use strict"; @@ -18707,13 +18817,13 @@ module.exports = { /***/ }), -/***/ 220: +/***/ 3682: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { ReadableStreamFrom, isBlobLike, @@ -18723,16 +18833,16 @@ const { fullyReadBody, extractMimeType, utf8DecodeBytes -} = __nccwpck_require__(9808) -const { FormData } = __nccwpck_require__(2198) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { FormData } = __nccwpck_require__(7064) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) const { Blob } = __nccwpck_require__(4573) const assert = __nccwpck_require__(4589) const { isErrored, isDisturbed } = __nccwpck_require__(7075) const { isArrayBuffer } = __nccwpck_require__(3429) -const { serializeAMimeType } = __nccwpck_require__(8828) -const { multipartFormDataParser } = __nccwpck_require__(6052) +const { serializeAMimeType } = __nccwpck_require__(4622) +const { multipartFormDataParser } = __nccwpck_require__(5670) let random try { @@ -19244,7 +19354,7 @@ module.exports = { /***/ }), -/***/ 1935: +/***/ 3169: /***/ ((module) => { "use strict"; @@ -19376,7 +19486,7 @@ module.exports = { /***/ }), -/***/ 8828: +/***/ 4622: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -20128,13 +20238,13 @@ module.exports = { /***/ }), -/***/ 125: +/***/ 3207: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConnected, kSize } = __nccwpck_require__(1675) +const { kConnected, kSize } = __nccwpck_require__(8705) class CompatWeakRef { constructor (value) { @@ -20182,15 +20292,15 @@ module.exports = function () { /***/ }), -/***/ 8250: +/***/ 4052: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Blob, File } = __nccwpck_require__(4573) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) // TODO(@KhafraDev): remove class FileLike { @@ -20316,17 +20426,17 @@ module.exports = { FileLike, isFileLike } /***/ }), -/***/ 6052: +/***/ 5670: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { utf8DecodeBytes } = __nccwpck_require__(9808) -const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(8828) -const { isFileLike } = __nccwpck_require__(8250) -const { makeEntry } = __nccwpck_require__(2198) +const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { utf8DecodeBytes } = __nccwpck_require__(9614) +const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(4622) +const { isFileLike } = __nccwpck_require__(4052) +const { makeEntry } = __nccwpck_require__(7064) const assert = __nccwpck_require__(4589) const { File: NodeFile } = __nccwpck_require__(4573) @@ -20798,17 +20908,17 @@ module.exports = { /***/ }), -/***/ 2198: +/***/ 7064: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isBlobLike, iteratorMixin } = __nccwpck_require__(9808) -const { kState } = __nccwpck_require__(2043) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { FileLike, isFileLike } = __nccwpck_require__(8250) -const { webidl } = __nccwpck_require__(613) +const { isBlobLike, iteratorMixin } = __nccwpck_require__(9614) +const { kState } = __nccwpck_require__(4701) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { FileLike, isFileLike } = __nccwpck_require__(4052) +const { webidl } = __nccwpck_require__(4195) const { File: NativeFile } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) @@ -21058,7 +21168,7 @@ module.exports = { FormData, makeEntry } /***/ }), -/***/ 5699: +/***/ 7573: /***/ ((module) => { "use strict"; @@ -21106,7 +21216,7 @@ module.exports = { /***/ }), -/***/ 6548: +/***/ 4478: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -21114,14 +21224,14 @@ module.exports = { -const { kConstruct } = __nccwpck_require__(1675) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(8705) +const { kEnumerableProperty } = __nccwpck_require__(2250) const { iteratorMixin, isValidHeaderName, isValidHeaderValue -} = __nccwpck_require__(9808) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { webidl } = __nccwpck_require__(4195) const assert = __nccwpck_require__(4589) const util = __nccwpck_require__(7975) @@ -21801,7 +21911,7 @@ module.exports = { /***/ }), -/***/ 782: +/***/ 5404: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -21815,9 +21925,9 @@ const { filterResponse, makeResponse, fromInnerResponse -} = __nccwpck_require__(2603) -const { HeadersList } = __nccwpck_require__(6548) -const { Request, cloneRequest } = __nccwpck_require__(6607) +} = __nccwpck_require__(5093) +const { HeadersList } = __nccwpck_require__(4478) +const { Request, cloneRequest } = __nccwpck_require__(2257) const zlib = __nccwpck_require__(8522) const { bytesMatch, @@ -21853,23 +21963,23 @@ const { buildContentRange, createInflate, extractMimeType -} = __nccwpck_require__(9808) -const { kState, kDispatcher } = __nccwpck_require__(2043) +} = __nccwpck_require__(9614) +const { kState, kDispatcher } = __nccwpck_require__(4701) const assert = __nccwpck_require__(4589) -const { safelyExtractBody, extractBody } = __nccwpck_require__(220) +const { safelyExtractBody, extractBody } = __nccwpck_require__(3682) const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const EE = __nccwpck_require__(8474) const { Readable, pipeline, finished } = __nccwpck_require__(7075) -const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(8828) -const { getGlobalDispatcher } = __nccwpck_require__(197) -const { webidl } = __nccwpck_require__(613) +const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(4622) +const { getGlobalDispatcher } = __nccwpck_require__(6759) +const { webidl } = __nccwpck_require__(4195) const { STATUS_CODES } = __nccwpck_require__(7067) const GET_OR_HEAD = ['GET', 'HEAD'] @@ -24081,7 +24191,7 @@ module.exports = { /***/ }), -/***/ 6607: +/***/ 2257: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -24089,16 +24199,16 @@ module.exports = { -const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(220) -const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(6548) -const { FinalizationRegistry } = __nccwpck_require__(125)() -const util = __nccwpck_require__(3792) +const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(3682) +const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(4478) +const { FinalizationRegistry } = __nccwpck_require__(3207)() +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { isValidHTTPToken, sameOrigin, environmentSettingsObject -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { forbiddenMethodsSet, corsSafeListedMethodsSet, @@ -24108,12 +24218,12 @@ const { requestCredentials, requestCache, requestDuplex -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util -const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474) @@ -25126,15 +25236,15 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest } /***/ }), -/***/ 2603: +/***/ 5093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(6548) -const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(220) -const util = __nccwpck_require__(3792) +const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(4478) +const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(3682) +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { kEnumerableProperty } = util const { @@ -25146,16 +25256,16 @@ const { isErrorLike, isomorphicEncode, environmentSettingsObject: relevantRealm -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { redirectStatusSet, nullBodyStatus -} = __nccwpck_require__(1935) -const { kState, kHeaders } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { FormData } = __nccwpck_require__(2198) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +} = __nccwpck_require__(3169) +const { kState, kHeaders } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { FormData } = __nccwpck_require__(7064) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { types } = __nccwpck_require__(7975) @@ -25744,7 +25854,7 @@ module.exports = { /***/ }), -/***/ 2043: +/***/ 4701: /***/ ((module) => { "use strict"; @@ -25761,7 +25871,7 @@ module.exports = { /***/ }), -/***/ 9808: +/***/ 9614: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -25769,14 +25879,14 @@ module.exports = { const { Transform } = __nccwpck_require__(7075) const zlib = __nccwpck_require__(8522) -const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1935) -const { getGlobalOrigin } = __nccwpck_require__(5699) -const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(8828) +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(3169) +const { getGlobalOrigin } = __nccwpck_require__(7573) +const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(4622) const { performance } = __nccwpck_require__(643) -const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3792) +const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(2250) const assert = __nccwpck_require__(4589) const { isUint8Array } = __nccwpck_require__(3429) -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) let supportedHashes = [] @@ -27401,7 +27511,7 @@ module.exports = { /***/ }), -/***/ 613: +/***/ 4195: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -27409,7 +27519,7 @@ module.exports = { const { types, inspect } = __nccwpck_require__(7975) const { markAsUncloneable } = __nccwpck_require__(5919) -const { toUSVString } = __nccwpck_require__(3792) +const { toUSVString } = __nccwpck_require__(2250) /** @type {import('../../../types/webidl').Webidl} */ const webidl = {} @@ -28104,7 +28214,7 @@ module.exports = { /***/ }), -/***/ 9919: +/***/ 7261: /***/ ((module) => { "use strict"; @@ -28402,7 +28512,7 @@ module.exports = { /***/ }), -/***/ 9395: +/***/ 6705: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -28412,16 +28522,16 @@ const { staticPropertyDescriptors, readOperation, fireAProgressEvent -} = __nccwpck_require__(3738) +} = __nccwpck_require__(6532) const { kState, kError, kResult, kEvents, kAborted -} = __nccwpck_require__(2913) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +} = __nccwpck_require__(9671) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class FileReader extends EventTarget { constructor () { @@ -28754,13 +28864,13 @@ module.exports = { /***/ }), -/***/ 7101: +/***/ 8731: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) const kState = Symbol('ProgressEvent state') @@ -28840,7 +28950,7 @@ module.exports = { /***/ }), -/***/ 2913: +/***/ 9671: /***/ ((module) => { "use strict"; @@ -28858,7 +28968,7 @@ module.exports = { /***/ }), -/***/ 3738: +/***/ 6532: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -28870,10 +28980,10 @@ const { kResult, kAborted, kLastProgressEventFired -} = __nccwpck_require__(2913) -const { ProgressEvent } = __nccwpck_require__(7101) -const { getEncoding } = __nccwpck_require__(9919) -const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(8828) +} = __nccwpck_require__(9671) +const { ProgressEvent } = __nccwpck_require__(8731) +const { getEncoding } = __nccwpck_require__(7261) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4622) const { types } = __nccwpck_require__(7975) const { StringDecoder } = __nccwpck_require__(3193) const { btoa } = __nccwpck_require__(4573) @@ -29257,28 +29367,28 @@ module.exports = { /***/ }), -/***/ 737: +/***/ 2379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(2512) +const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(362) const { kReadyState, kSentClose, kByteParser, kReceivedClose, kResponse -} = __nccwpck_require__(9360) -const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(4081) -const { channels } = __nccwpck_require__(7822) -const { CloseEvent } = __nccwpck_require__(8916) -const { makeRequest } = __nccwpck_require__(6607) -const { fetching } = __nccwpck_require__(782) -const { Headers, getHeadersList } = __nccwpck_require__(6548) -const { getDecodeSplit } = __nccwpck_require__(9808) -const { WebsocketFrameSend } = __nccwpck_require__(2928) +} = __nccwpck_require__(6858) +const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(343) +const { channels } = __nccwpck_require__(6692) +const { CloseEvent } = __nccwpck_require__(4926) +const { makeRequest } = __nccwpck_require__(2257) +const { fetching } = __nccwpck_require__(5404) +const { Headers, getHeadersList } = __nccwpck_require__(4478) +const { getDecodeSplit } = __nccwpck_require__(9614) +const { WebsocketFrameSend } = __nccwpck_require__(9506) /** @type {import('crypto')} */ let crypto @@ -29636,7 +29746,7 @@ module.exports = { /***/ }), -/***/ 2512: +/***/ 362: /***/ ((module) => { "use strict"; @@ -29710,15 +29820,15 @@ module.exports = { /***/ }), -/***/ 8916: +/***/ 4926: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { kConstruct } = __nccwpck_require__(1675) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { kConstruct } = __nccwpck_require__(8705) const { MessagePort } = __nccwpck_require__(5919) /** @@ -30047,13 +30157,13 @@ module.exports = { /***/ }), -/***/ 2928: +/***/ 9506: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxUnsigned16Bit } = __nccwpck_require__(2512) +const { maxUnsigned16Bit } = __nccwpck_require__(362) const BUFFER_SIZE = 16386 @@ -30151,15 +30261,15 @@ module.exports = { /***/ }), -/***/ 477: +/***/ 1087: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522) -const { isValidClientWindowBits } = __nccwpck_require__(4081) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +const { isValidClientWindowBits } = __nccwpck_require__(343) +const { MessageSizeExceededError } = __nccwpck_require__(7617) const tail = Buffer.from([0x00, 0x00, 0xff, 0xff]) const kBuffer = Symbol('kBuffer') @@ -30259,7 +30369,7 @@ module.exports = { PerMessageDeflate } /***/ }), -/***/ 148: +/***/ 4658: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -30267,9 +30377,9 @@ module.exports = { PerMessageDeflate } const { Writable } = __nccwpck_require__(7075) const assert = __nccwpck_require__(4589) -const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(2512) -const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(9360) -const { channels } = __nccwpck_require__(7822) +const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(362) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(6858) +const { channels } = __nccwpck_require__(6692) const { isValidStatusCode, isValidOpcode, @@ -30279,11 +30389,16 @@ const { isControlFrame, isTextBinaryFrame, isContinuationFrame -} = __nccwpck_require__(4081) -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { closeWebSocketConnection } = __nccwpck_require__(737) -const { PerMessageDeflate } = __nccwpck_require__(477) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +} = __nccwpck_require__(343) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { closeWebSocketConnection } = __nccwpck_require__(2379) +const { PerMessageDeflate } = __nccwpck_require__(1087) +const { MessageSizeExceededError } = __nccwpck_require__(7617) + +function failWebsocketConnectionWithCode (ws, code, reason) { + closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason)) + failWebsocketConnection(ws, reason) +} // This code was influenced by ws released under the MIT license. // Copyright (c) 2011 Einar Otto Stangvik @@ -30304,19 +30419,23 @@ class ByteParser extends Writable { /** @type {Map} */ #extensions + /** @type {number} */ + #maxFragments + /** @type {number} */ #maxPayloadSize /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions - * @param {{ maxPayloadSize?: number }} [options] + * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options] */ constructor (ws, extensions, options = {}) { super() this.ws = ws this.#extensions = extensions == null ? new Map() : extensions + this.#maxFragments = options.maxFragments ?? 0 this.#maxPayloadSize = options.maxPayloadSize ?? 0 if (this.#extensions.has('permessage-deflate')) { @@ -30340,9 +30459,9 @@ class ByteParser extends Writable { if ( this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && - this.#info.payloadLength > this.#maxPayloadSize + this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize ) { - failWebsocketConnection(this.ws, 'Payload size exceeds maximum allowed size') + failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size') return false } @@ -30507,10 +30626,12 @@ class ByteParser extends Writable { this.#state = parserStates.INFO } else { if (!this.#info.compressed) { - this.writeFragments(body) + if (!this.writeFragments(body)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -30529,14 +30650,17 @@ class ByteParser extends Writable { this.#info.fin, (error, data) => { if (error) { - failWebsocketConnection(this.ws, error.message) + const code = error instanceof MessageSizeExceededError ? 1009 : 1007 + failWebsocketConnectionWithCode(this.ws, code, error.message) return } - this.writeFragments(data) + if (!this.writeFragments(data)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -30606,8 +30730,17 @@ class ByteParser extends Writable { } writeFragments (fragment) { + if ( + this.#maxFragments > 0 && + this.#fragments.length === this.#maxFragments + ) { + failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments') + return false + } + this.#fragmentsBytes += fragment.length this.#fragments.push(fragment) + return true } consumeFragments () { @@ -30757,15 +30890,15 @@ module.exports = { /***/ }), -/***/ 5164: +/***/ 7526: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { opcodes, sendHints } = __nccwpck_require__(2512) -const FixedQueue = __nccwpck_require__(8692) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { opcodes, sendHints } = __nccwpck_require__(362) +const FixedQueue = __nccwpck_require__(894) /** @type {typeof Uint8Array} */ const FastBuffer = Buffer[Symbol.species] @@ -30869,7 +31002,7 @@ module.exports = { SendQueue } /***/ }), -/***/ 9360: +/***/ 6858: /***/ ((module) => { "use strict"; @@ -30889,17 +31022,17 @@ module.exports = { /***/ }), -/***/ 4081: +/***/ 343: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(9360) -const { states, opcodes } = __nccwpck_require__(2512) -const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(8916) +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(6858) +const { states, opcodes } = __nccwpck_require__(362) +const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(4926) const { isUtf8 } = __nccwpck_require__(4573) -const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(8828) +const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(4622) /* globals Blob */ @@ -31219,16 +31352,16 @@ module.exports = { /***/ }), -/***/ 5134: +/***/ 9480: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { environmentSettingsObject } = __nccwpck_require__(9808) -const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(2512) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { environmentSettingsObject } = __nccwpck_require__(9614) +const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(362) const { kWebSocketURL, kReadyState, @@ -31237,21 +31370,21 @@ const { kResponse, kSentClose, kByteParser -} = __nccwpck_require__(9360) +} = __nccwpck_require__(6858) const { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent -} = __nccwpck_require__(4081) -const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(737) -const { ByteParser } = __nccwpck_require__(148) -const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3792) -const { getGlobalDispatcher } = __nccwpck_require__(197) +} = __nccwpck_require__(343) +const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(2379) +const { ByteParser } = __nccwpck_require__(4658) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(2250) +const { getGlobalDispatcher } = __nccwpck_require__(6759) const { types } = __nccwpck_require__(7975) -const { ErrorEvent, CloseEvent } = __nccwpck_require__(8916) -const { SendQueue } = __nccwpck_require__(5164) +const { ErrorEvent, CloseEvent } = __nccwpck_require__(4926) +const { SendQueue } = __nccwpck_require__(7526) // https://websockets.spec.whatwg.org/#interface-definition class WebSocket extends EventTarget { @@ -31660,9 +31793,12 @@ class WebSocket extends EventTarget { // once this happens, the connection is open this[kResponse] = response - const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize + const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions + const maxFragments = webSocketOptions?.maxFragments + const maxPayloadSize = webSocketOptions?.maxPayloadSize const parser = new ByteParser(this, parsedExtensions, { + maxFragments, maxPayloadSize }) parser.on('drain', onParserDrain) @@ -32228,13 +32364,13 @@ exports.range = range; /***/ }), -/***/ 8797: +/***/ 5994: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EXPANSION_MAX = void 0; +exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0; exports.expand = expand; const balanced_match_1 = __nccwpck_require__(5192); const escSlash = '\0SLASH' + Math.random() + '\0'; @@ -32253,6 +32389,17 @@ const closePattern = /\\}/g; const commaPattern = /\\,/g; const periodPattern = /\\\./g; exports.EXPANSION_MAX = 100_000; +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +exports.EXPANSION_MAX_LENGTH = 4_000_000; function numeric(str) { return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); } @@ -32302,7 +32449,7 @@ function expand(str, options = {}) { if (!str) { return []; } - const { max = exports.EXPANSION_MAX } = options; + const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, @@ -32312,7 +32459,7 @@ function expand(str, options = {}) { if (str.slice(0, 2) === '{}') { str = '\\{\\}' + str.slice(2); } - return expand_(escapeBraces(str), max, true).map(unescapeBraces); + return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); } function embrace(str) { return '{' + str + '}'; @@ -32326,22 +32473,117 @@ function lte(i, y) { function gte(i, y) { return i >= y; } -function expand_(str, max, isTop) { - /** @type {string[]} */ - const expansions = []; - const m = (0, balanced_match_1.balanced)('{', '}', str); - if (!m) - return [str]; - // no need to expand pre, since it is guaranteed to be free of brace-sets - const pre = m.pre; - const post = m.post.length ? expand_(m.post, max, false) : ['']; - if (/\$$/.test(m.pre)) { - for (let k = 0; k < post.length && k < max; k++) { - const expansion = pre + '{' + m.body + '}' + post[k]; - expansions.push(expansion); +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +function combine(acc, pre, values, max, maxLength, dropEmpties) { + const out = []; + let length = 0; + for (let a = 0; a < acc.length; a++) { + for (let v = 0; v < values.length; v++) { + if (out.length >= max) + return out; + const expansion = acc[a] + pre + values[v]; + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. + if (dropEmpties && !expansion) + continue; + if (length + expansion.length > maxLength) + return out; + out.push(expansion); + length += expansion.length; } } - else { + return out; +} +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence(body, isAlphaSequence, max, maxLength) { + const n = body.split(/\.\./); + const N = []; + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N; + } + /* c8 ignore stop */ + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + let length = 0; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + if (length + c.length > maxLength) + break; + N.push(c); + length += c.length; + } + return N; +} +function expand_(str, max, maxLength, isTop) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + let acc = ['']; + // Bash drops empty results, but only when the *first* top-level group is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + let dropEmpties = false; + let firstGroup = true; + for (;;) { + const m = (0, balanced_match_1.balanced)('{', '}', str); + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, str, [''], max, maxLength, dropEmpties); + } + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + if (/\$$/.test(pre)) { + acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length); + firstGroup = false; + if (!m.post.length) + break; + str = m.post; + continue; + } const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); const isSequence = isNumericSequence || isAlphaSequence; @@ -32350,87 +32592,69 @@ function expand_(str, max, isTop) { // {a},b} if (m.post.match(/,(?!,).*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; - return expand_(str, max, true); + isTop = true; + continue; } - return [str]; + // Nothing here expands, so the whole remaining string is literal. + return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties); } - let n; + if (firstGroup) { + dropEmpties = isTop && !isSequence; + firstGroup = false; + } + let values; if (isSequence) { - n = m.body.split(/\.\./); + values = expandSequence(m.body, isAlphaSequence, max, maxLength); } else { - n = parseCommaParts(m.body); + let n = parseCommaParts(m.body); if (n.length === 1 && n[0] !== undefined) { // x{{a,b}}y ==> x{a}y x{b}y - n = expand_(n[0], max, false).map(embrace); + n = expand_(n[0], max, maxLength, false).map(embrace); //XXX is this necessary? Can't seem to hit it in tests. /* c8 ignore start */ if (n.length === 1) { - return post.map(p => m.pre + n[0] + p); + acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + continue; } /* c8 ignore stop */ } - } - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - let N; - if (isSequence && n[0] !== undefined && n[1] !== undefined) { - const x = numeric(n[0]); - const y = numeric(n[1]); - const width = Math.max(n[0].length, n[1].length); - let incr = n.length === 3 && n[2] !== undefined ? - Math.max(Math.abs(numeric(n[2])), 1) - : 1; - let test = lte; - const reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - const pad = n.some(isPadded); - N = []; - for (let i = x; test(i, y) && N.length < max; i += incr) { - let c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') { - c = ''; - } - } - else { - c = String(i); - if (pad) { - const need = width - c.length; - if (need > 0) { - const z = new Array(need + 1).join('0'); - if (i < 0) { - c = '-' + z + c.slice(1); - } - else { - c = z + c; - } - } - } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; } - N.push(c); - } - } - else { - N = []; - for (let j = 0; j < n.length; j++) { - N.push.apply(N, expand_(n[j], max, false)); } - } - for (let j = 0; j < N.length; j++) { - for (let k = 0; k < post.length && expansions.length < max; k++) { - const expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) { - expansions.push(expansion); + values = []; + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; } } } + acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; } - return expansions; + return acc; } //# sourceMappingURL=index.js.map @@ -33688,7 +33912,7 @@ exports.escape = escape; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; -const brace_expansion_1 = __nccwpck_require__(8797); +const brace_expansion_1 = __nccwpck_require__(5994); const assert_valid_pattern_js_1 = __nccwpck_require__(2012); const ast_js_1 = __nccwpck_require__(5492); const escape_js_1 = __nccwpck_require__(6917); diff --git a/send-teams-notification/dist/index.js b/send-teams-notification/dist/index.js index 38f1dd2..c071364 100644 --- a/send-teams-notification/dist/index.js +++ b/send-teams-notification/dist/index.js @@ -2139,7 +2139,7 @@ exports.getProxyAgentDispatcher = getProxyAgentDispatcher; exports.getProxyFetch = getProxyFetch; exports.getApiBaseUrl = getApiBaseUrl; const httpClient = __importStar(__nccwpck_require__(5270)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -2391,7 +2391,7 @@ const http = __importStar(__nccwpck_require__(8611)); const https = __importStar(__nccwpck_require__(5692)); const pm = __importStar(__nccwpck_require__(9154)); const tunnel = __importStar(__nccwpck_require__(2695)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -4416,7 +4416,7 @@ var bind = __nccwpck_require__(911); var $apply = __nccwpck_require__(8860); var $call = __nccwpck_require__(3582); -var $reflectApply = __nccwpck_require__(5093); +var $reflectApply = __nccwpck_require__(7474); /** @type {import('./actualApply')} */ module.exports = $reflectApply || bind.call($call, $apply); @@ -4448,7 +4448,7 @@ module.exports = Function.prototype.call; /***/ }), -/***/ 7312: +/***/ 4931: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4471,7 +4471,7 @@ module.exports = function callBindBasic(args) { /***/ }), -/***/ 5093: +/***/ 7474: /***/ ((module) => { "use strict"; @@ -5683,7 +5683,7 @@ DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { "use strict"; -var callBind = __nccwpck_require__(7312); +var callBind = __nccwpck_require__(4931); var gOPD = __nccwpck_require__(9380); var hasProtoAccessor; @@ -5785,7 +5785,7 @@ module.exports = ReferenceError; /***/ }), -/***/ 5404: +/***/ 3023: /***/ ((module) => { "use strict"; @@ -7265,7 +7265,7 @@ var $Error = __nccwpck_require__(1823); var $EvalError = __nccwpck_require__(2013); var $RangeError = __nccwpck_require__(210); var $ReferenceError = __nccwpck_require__(8746); -var $SyntaxError = __nccwpck_require__(5404); +var $SyntaxError = __nccwpck_require__(3023); var $TypeError = __nccwpck_require__(8291); var $URIError = __nccwpck_require__(9785); @@ -8464,7 +8464,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.IncomingWebhook = void 0; -const axios_1 = __importDefault(__nccwpck_require__(9499)); +const axios_1 = __importDefault(__nccwpck_require__(3117)); class IncomingWebhook { constructor(url) { if (url === undefined) { @@ -9115,34 +9115,34 @@ exports.debug = debug; // for test /***/ }), -/***/ 9280: +/***/ 4782: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Client = __nccwpck_require__(5621) -const Dispatcher = __nccwpck_require__(6307) -const Pool = __nccwpck_require__(1748) -const BalancedPool = __nccwpck_require__(9717) -const Agent = __nccwpck_require__(8717) -const ProxyAgent = __nccwpck_require__(4800) -const EnvHttpProxyAgent = __nccwpck_require__(6753) -const RetryAgent = __nccwpck_require__(6770) -const errors = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +const Client = __nccwpck_require__(8223) +const Dispatcher = __nccwpck_require__(5353) +const Pool = __nccwpck_require__(5326) +const BalancedPool = __nccwpck_require__(9159) +const Agent = __nccwpck_require__(1891) +const ProxyAgent = __nccwpck_require__(5678) +const EnvHttpProxyAgent = __nccwpck_require__(7227) +const RetryAgent = __nccwpck_require__(8792) +const errors = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { InvalidArgumentError } = errors -const api = __nccwpck_require__(9719) -const buildConnector = __nccwpck_require__(6768) -const MockClient = __nccwpck_require__(4997) -const MockAgent = __nccwpck_require__(8269) -const MockPool = __nccwpck_require__(1828) -const mockErrors = __nccwpck_require__(93) -const RetryHandler = __nccwpck_require__(2728) -const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(197) -const DecoratorHandler = __nccwpck_require__(2587) -const RedirectHandler = __nccwpck_require__(5458) -const createRedirectInterceptor = __nccwpck_require__(7780) +const api = __nccwpck_require__(497) +const buildConnector = __nccwpck_require__(5634) +const MockClient = __nccwpck_require__(3735) +const MockAgent = __nccwpck_require__(3627) +const MockPool = __nccwpck_require__(6134) +const mockErrors = __nccwpck_require__(9539) +const RetryHandler = __nccwpck_require__(8022) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(6759) +const DecoratorHandler = __nccwpck_require__(3253) +const RedirectHandler = __nccwpck_require__(9104) +const createRedirectInterceptor = __nccwpck_require__(5914) Object.assign(Dispatcher.prototype, api) @@ -9160,10 +9160,10 @@ module.exports.DecoratorHandler = DecoratorHandler module.exports.RedirectHandler = RedirectHandler module.exports.createRedirectInterceptor = createRedirectInterceptor module.exports.interceptors = { - redirect: __nccwpck_require__(7594), - retry: __nccwpck_require__(9722), - dump: __nccwpck_require__(4972), - dns: __nccwpck_require__(4411) + redirect: __nccwpck_require__(2524), + retry: __nccwpck_require__(2644), + dump: __nccwpck_require__(6141), + dns: __nccwpck_require__(9765) } module.exports.buildConnector = buildConnector @@ -9225,7 +9225,7 @@ function makeDispatcher (fn) { module.exports.setGlobalDispatcher = setGlobalDispatcher module.exports.getGlobalDispatcher = getGlobalDispatcher -const fetchImpl = (__nccwpck_require__(782).fetch) +const fetchImpl = (__nccwpck_require__(5404).fetch) module.exports.fetch = async function fetch (init, options = undefined) { try { return await fetchImpl(init, options) @@ -9237,39 +9237,39 @@ module.exports.fetch = async function fetch (init, options = undefined) { throw err } } -module.exports.Headers = __nccwpck_require__(6548).Headers -module.exports.Response = __nccwpck_require__(2603).Response -module.exports.Request = __nccwpck_require__(6607).Request -module.exports.FormData = __nccwpck_require__(2198).FormData +module.exports.Headers = __nccwpck_require__(4478).Headers +module.exports.Response = __nccwpck_require__(5093).Response +module.exports.Request = __nccwpck_require__(2257).Request +module.exports.FormData = __nccwpck_require__(7064).FormData module.exports.File = globalThis.File ?? (__nccwpck_require__(4573).File) -module.exports.FileReader = __nccwpck_require__(9395).FileReader +module.exports.FileReader = __nccwpck_require__(6705).FileReader -const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(5699) +const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(7573) module.exports.setGlobalOrigin = setGlobalOrigin module.exports.getGlobalOrigin = getGlobalOrigin -const { CacheStorage } = __nccwpck_require__(8733) -const { kConstruct } = __nccwpck_require__(2045) +const { CacheStorage } = __nccwpck_require__(2363) +const { kConstruct } = __nccwpck_require__(4527) // Cache & CacheStorage are tightly coupled with fetch. Even if it may run // in an older version of Node, it doesn't have any use without fetch. module.exports.caches = new CacheStorage(kConstruct) -const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1973) +const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(6783) module.exports.deleteCookie = deleteCookie module.exports.getCookies = getCookies module.exports.getSetCookies = getSetCookies module.exports.setCookie = setCookie -const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(8828) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4622) module.exports.parseMIMEType = parseMIMEType module.exports.serializeAMimeType = serializeAMimeType -const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(8916) -module.exports.WebSocket = __nccwpck_require__(5134).WebSocket +const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(4926) +module.exports.WebSocket = __nccwpck_require__(9480).WebSocket module.exports.CloseEvent = CloseEvent module.exports.ErrorEvent = ErrorEvent module.exports.MessageEvent = MessageEvent @@ -9285,18 +9285,18 @@ module.exports.MockPool = MockPool module.exports.MockAgent = MockAgent module.exports.mockErrors = mockErrors -const { EventSource } = __nccwpck_require__(4886) +const { EventSource } = __nccwpck_require__(5768) module.exports.EventSource = EventSource /***/ }), -/***/ 1006: +/***/ 6720: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { addAbortListener } = __nccwpck_require__(3792) -const { RequestAbortedError } = __nccwpck_require__(9715) +const { addAbortListener } = __nccwpck_require__(2250) +const { RequestAbortedError } = __nccwpck_require__(7617) const kListener = Symbol('kListener') const kSignal = Symbol('kSignal') @@ -9356,7 +9356,7 @@ module.exports = { /***/ }), -/***/ 2772: +/***/ 6958: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -9364,9 +9364,9 @@ module.exports = { const assert = __nccwpck_require__(4589) const { AsyncResource } = __nccwpck_require__(6698) -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class ConnectHandler extends AsyncResource { constructor (opts, callback) { @@ -9472,7 +9472,7 @@ module.exports = connect /***/ }), -/***/ 2846: +/***/ 8084: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -9487,10 +9487,10 @@ const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) const kResume = Symbol('resume') @@ -9731,17 +9731,17 @@ module.exports = pipeline /***/ }), -/***/ 8875: +/***/ 353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { Readable } = __nccwpck_require__(3159) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { Readable } = __nccwpck_require__(105) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) class RequestHandler extends AsyncResource { @@ -9953,7 +9953,7 @@ module.exports.RequestHandler = RequestHandler /***/ }), -/***/ 9560: +/***/ 7010: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -9961,11 +9961,11 @@ module.exports.RequestHandler = RequestHandler const assert = __nccwpck_require__(4589) const { finished, PassThrough } = __nccwpck_require__(7075) -const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { @@ -10181,16 +10181,16 @@ module.exports = stream /***/ }), -/***/ 6538: +/***/ 7312: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) const { AsyncResource } = __nccwpck_require__(6698) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) class UpgradeHandler extends AsyncResource { @@ -10297,22 +10297,22 @@ module.exports = upgrade /***/ }), -/***/ 9719: +/***/ 497: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports.request = __nccwpck_require__(8875) -module.exports.stream = __nccwpck_require__(9560) -module.exports.pipeline = __nccwpck_require__(2846) -module.exports.upgrade = __nccwpck_require__(6538) -module.exports.connect = __nccwpck_require__(2772) +module.exports.request = __nccwpck_require__(353) +module.exports.stream = __nccwpck_require__(7010) +module.exports.pipeline = __nccwpck_require__(8084) +module.exports.upgrade = __nccwpck_require__(7312) +module.exports.connect = __nccwpck_require__(6958) /***/ }), -/***/ 3159: +/***/ 105: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10322,9 +10322,9 @@ module.exports.connect = __nccwpck_require__(2772) const assert = __nccwpck_require__(4589) const { Readable } = __nccwpck_require__(7075) -const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { ReadableStreamFrom } = __nccwpck_require__(3792) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { ReadableStreamFrom } = __nccwpck_require__(2250) const kConsume = Symbol('kConsume') const kReading = Symbol('kReading') @@ -10705,15 +10705,15 @@ module.exports = { Readable: BodyReadable, chunksDecode } /***/ }), -/***/ 343: +/***/ 1337: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) const { ResponseStatusCodeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) -const { chunksDecode } = __nccwpck_require__(3159) +const { chunksDecode } = __nccwpck_require__(105) const CHUNK_LIMIT = 128 * 1024 async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { @@ -10805,7 +10805,7 @@ module.exports = { /***/ }), -/***/ 6768: +/***/ 5634: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10813,9 +10813,9 @@ module.exports = { const net = __nccwpck_require__(7030) const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(9715) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(7617) +const timers = __nccwpck_require__(2841) function noop () {} @@ -11053,7 +11053,7 @@ module.exports = buildConnector /***/ }), -/***/ 2239: +/***/ 885: /***/ ((module) => { "use strict"; @@ -11179,7 +11179,7 @@ module.exports = { /***/ }), -/***/ 7822: +/***/ 6692: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -11389,7 +11389,7 @@ module.exports = { /***/ }), -/***/ 9715: +/***/ 7617: /***/ ((module) => { "use strict"; @@ -11822,7 +11822,7 @@ module.exports = { /***/ }), -/***/ 8655: +/***/ 7533: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -11831,7 +11831,7 @@ module.exports = { const { InvalidArgumentError, NotSupportedError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const assert = __nccwpck_require__(4589) const { isValidHTTPToken, @@ -11846,9 +11846,9 @@ const { validateHandler, getServerName, normalizedMethodRecords -} = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) +} = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) // Verifies that a given path is valid does not contain control chars \x00 to \x20 const invalidPathRegex = /[^\u0021-\u00ff]/ @@ -12235,7 +12235,7 @@ module.exports = Request /***/ }), -/***/ 1675: +/***/ 8705: /***/ ((module) => { module.exports = { @@ -12309,7 +12309,7 @@ module.exports = { /***/ }), -/***/ 4184: +/***/ 8174: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -12318,7 +12318,7 @@ module.exports = { const { wellknownHeaderNames, headerNameLowerCasedRecord -} = __nccwpck_require__(2239) +} = __nccwpck_require__(885) class TstNode { /** @type {any} */ @@ -12469,14 +12469,14 @@ module.exports = { /***/ }), -/***/ 3792: +/***/ 2250: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(1675) +const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(8705) const { IncomingMessage } = __nccwpck_require__(7067) const stream = __nccwpck_require__(7075) const net = __nccwpck_require__(7030) @@ -12484,9 +12484,9 @@ const { Blob } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) const { stringify } = __nccwpck_require__(1792) const { EventEmitter: EE } = __nccwpck_require__(8474) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) -const { tree } = __nccwpck_require__(4184) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) +const { tree } = __nccwpck_require__(8174) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) @@ -13196,19 +13196,19 @@ module.exports = { /***/ }), -/***/ 8717: +/***/ 1891: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) -const DispatcherBase = __nccwpck_require__(9921) -const Pool = __nccwpck_require__(1748) -const Client = __nccwpck_require__(5621) -const util = __nccwpck_require__(3792) -const createRedirectInterceptor = __nccwpck_require__(7780) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) +const DispatcherBase = __nccwpck_require__(2403) +const Pool = __nccwpck_require__(5326) +const Client = __nccwpck_require__(8223) +const util = __nccwpck_require__(2250) +const createRedirectInterceptor = __nccwpck_require__(5914) const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') @@ -13226,7 +13226,6 @@ function defaultFactory (origin, opts) { class Agent extends DispatcherBase { constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } @@ -13334,7 +13333,7 @@ module.exports = Agent /***/ }), -/***/ 9717: +/***/ 9159: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -13343,7 +13342,7 @@ module.exports = Agent const { BalancedPoolMissingUpstreamError, InvalidArgumentError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { PoolBase, kClients, @@ -13351,10 +13350,10 @@ const { kAddClient, kRemoveClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Pool = __nccwpck_require__(1748) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const { parseOrigin } = __nccwpck_require__(3792) +} = __nccwpck_require__(7262) +const Pool = __nccwpck_require__(5326) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const { parseOrigin } = __nccwpck_require__(2250) const kFactory = Symbol('factory') const kOptions = Symbol('options') @@ -13551,7 +13550,7 @@ module.exports = BalancedPool /***/ }), -/***/ 2285: +/***/ 8875: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -13560,9 +13559,9 @@ module.exports = BalancedPool /* global WebAssembly */ const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const timers = __nccwpck_require__(2841) const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, @@ -13574,7 +13573,7 @@ const { BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -13607,22 +13606,25 @@ const { kOnError, kResume, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) -const constants = __nccwpck_require__(9368) +const constants = __nccwpck_require__(6882) const EMPTY_BUF = Buffer.alloc(0) const FastBuffer = Buffer[Symbol.species] const addListener = util.addListener const removeAllListeners = util.removeAllListeners +const kIdleSocketValidation = Symbol('kIdleSocketValidation') +const kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout') +const kSocketUsed = Symbol('kSocketUsed') let extractBody async function lazyllhttp () { - const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(798) : undefined + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(4728) : undefined let mod try { - mod = await WebAssembly.compile(__nccwpck_require__(4682)) + mod = await WebAssembly.compile(__nccwpck_require__(5984)) } catch (e) { /* istanbul ignore next */ @@ -13630,7 +13632,7 @@ async function lazyllhttp () { // being enabled, but the occurring of this other error // * https://github.com/emscripten-core/emscripten/issues/11495 // got me to remove that check to avoid breaking Node 12. - mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(798)) + mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(4728)) } return await WebAssembly.instantiate(mod, { @@ -13836,29 +13838,71 @@ class Parser { const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr - if (ret === constants.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(data.slice(offset)) - } else if (ret === constants.ERROR.PAUSED) { - this.paused = true - socket.unshift(data.slice(offset)) - } else if (ret !== constants.ERROR.OK) { - const ptr = llhttp.llhttp_get_error_reason(this.ptr) - let message = '' - /* istanbul ignore else: difficult to make a test case for */ - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) - message = - 'Response does not match the HTTP/1.1 protocol (' + - Buffer.from(llhttp.memory.buffer, ptr, len).toString() + - ')' - } - throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + if (ret !== constants.ERROR.OK) { + const body = data.subarray(offset) + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(body) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(body) + } else { + throw this.createError(ret, body) + } } } catch (err) { util.destroy(socket, err) } } + finish () { + assert(currentParser === null) + assert(this.ptr != null) + assert(!this.paused) + + const { llhttp } = this + + let ret + + try { + currentParser = this + ret = llhttp.llhttp_finish(this.ptr) + } finally { + currentParser = null + } + + if (ret === constants.ERROR.OK) { + return null + } + + if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { + this.paused = true + return null + } + + return this.createError(ret, EMPTY_BUF) + } + + createError (ret, data) { + const { llhttp, contentLength, bytesRead } = this + + if (contentLength && bytesRead !== parseInt(contentLength, 10)) { + return new ResponseContentLengthMismatchError() + } + + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + + return new HTTPParserError(message, constants.ERROR[ret], data) + } + destroy () { assert(this.ptr != null) assert(currentParser == null) @@ -13886,6 +13930,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] if (!request) { return -1 @@ -13989,6 +14038,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] /* istanbul ignore next: difficult to make a test case for */ @@ -14162,6 +14216,7 @@ class Parser { request.onComplete(headers) client[kQueue][client[kRunningIdx]++] = null + socket[kSocketUsed] = true if (socket[kWriting]) { assert(client[kRunning] === 0) @@ -14220,6 +14275,9 @@ async function connectH1 (client, socket) { socket[kWriting] = false socket[kReset] = false socket[kBlocking] = false + socket[kIdleSocketValidation] = 0 + socket[kIdleSocketValidationTimeout] = null + socket[kSocketUsed] = false socket[kParser] = new Parser(client, socket, llhttpInstance) addListener(socket, 'error', function (err) { @@ -14230,8 +14288,11 @@ async function connectH1 (client, socket) { // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded // to the user. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so for as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + this[kError] = parserErr + this[kClient][kOnError](parserErr) + } return } @@ -14250,8 +14311,10 @@ async function connectH1 (client, socket) { const parser = this[kParser] if (parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + util.destroy(this, parserErr) + } return } @@ -14261,10 +14324,11 @@ async function connectH1 (client, socket) { const client = this[kClient] const parser = this[kParser] + clearIdleSocketValidation(this) + if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + this[kError] = parser.finish() || this[kError] } this[kParser].destroy() @@ -14327,7 +14391,7 @@ async function connectH1 (client, socket) { return socket.destroyed }, busy (request) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) { return true } @@ -14365,6 +14429,31 @@ async function connectH1 (client, socket) { } } +function clearIdleSocketValidation (socket) { + if (socket[kIdleSocketValidationTimeout]) { + clearTimeout(socket[kIdleSocketValidationTimeout]) + socket[kIdleSocketValidationTimeout] = null + } + + socket[kIdleSocketValidation] = 0 +} + +function scheduleIdleSocketValidation (client, socket) { + socket[kIdleSocketValidation] = 1 + socket[kIdleSocketValidationTimeout] = setTimeout(() => { + socket[kIdleSocketValidationTimeout] = null + socket[kIdleSocketValidation] = 2 + + if (client[kSocket] === socket && !socket.destroyed) { + client[kResume]() + } + }, 0) + socket[kIdleSocketValidationTimeout].unref?.() +} + +/** + * @param {import('./client.js')} client + */ function resumeH1 (client) { const socket = client[kSocket] @@ -14379,6 +14468,32 @@ function resumeH1 (client) { socket[kNoRef] = false } + if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) { + if (socket[kIdleSocketValidation] === 0) { + scheduleIdleSocketValidation(client, socket) + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + + if (socket[kIdleSocketValidation] === 1) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + } + + if (client[kRunning] === 0) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + } + if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE) @@ -14425,7 +14540,7 @@ function writeH1 (client, request) { if (util.isFormDataLike(body)) { if (!extractBody) { - extractBody = (__nccwpck_require__(220).extractBody) + extractBody = (__nccwpck_require__(3682).extractBody) } const [bodyStream, contentType] = extractBody(body) @@ -14472,6 +14587,7 @@ function writeH1 (client, request) { } const socket = client[kSocket] + clearIdleSocketValidation(socket) const abort = (err) => { if (request.aborted || request.completed) { @@ -14929,7 +15045,7 @@ module.exports = connectH1 /***/ }), -/***/ 4164: +/***/ 7662: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -14937,13 +15053,13 @@ module.exports = connectH1 const assert = __nccwpck_require__(4589) const { pipeline } = __nccwpck_require__(7075) -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -14962,7 +15078,7 @@ const { kResume, kSize, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) const kOpenStreams = Symbol('open streams') @@ -15321,7 +15437,7 @@ function writeH2 (client, request) { let contentLength = util.bodyLength(body) if (util.isFormDataLike(body)) { - extractBody ??= (__nccwpck_require__(220).extractBody) + extractBody ??= (__nccwpck_require__(3682).extractBody) const [bodyStream, contentType] = extractBody(body) headers['content-type'] = contentType @@ -15681,7 +15797,7 @@ module.exports = connectH2 /***/ }), -/***/ 5621: +/***/ 8223: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -15692,16 +15808,16 @@ module.exports = connectH2 const assert = __nccwpck_require__(4589) const net = __nccwpck_require__(7030) const http = __nccwpck_require__(7067) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const Request = __nccwpck_require__(8655) -const DispatcherBase = __nccwpck_require__(9921) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const Request = __nccwpck_require__(7533) +const DispatcherBase = __nccwpck_require__(2403) const { InvalidArgumentError, InformationalError, ClientDestroyedError -} = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) const { kUrl, kServerName, @@ -15743,9 +15859,9 @@ const { kHTTPContext, kMaxConcurrentStreams, kResume -} = __nccwpck_require__(1675) -const connectH1 = __nccwpck_require__(2285) -const connectH2 = __nccwpck_require__(4164) +} = __nccwpck_require__(8705) +const connectH1 = __nccwpck_require__(8875) +const connectH2 = __nccwpck_require__(7662) let deprecatedInterceptorWarned = false const kClosedResolve = Symbol('kClosedResolve') @@ -16052,7 +16168,7 @@ class Client extends DispatcherBase { } } -const createRedirectInterceptor = __nccwpck_require__(7780) +const createRedirectInterceptor = __nccwpck_require__(5914) function onError (client, err) { if ( @@ -16312,19 +16428,19 @@ module.exports = Client /***/ }), -/***/ 9921: +/***/ 2403: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) +const Dispatcher = __nccwpck_require__(5353) const { ClientDestroyedError, ClientClosedError, InvalidArgumentError -} = __nccwpck_require__(9715) -const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(1675) +} = __nccwpck_require__(7617) +const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(8705) const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') @@ -16344,6 +16460,7 @@ class DispatcherBase extends Dispatcher { get webSocketOptions () { return { + maxFragments: this[kWebSocketOptions].maxFragments ?? 131072, maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 } } @@ -16518,7 +16635,7 @@ module.exports = DispatcherBase /***/ }), -/***/ 6307: +/***/ 5353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -16591,16 +16708,16 @@ module.exports = Dispatcher /***/ }), -/***/ 6753: +/***/ 7227: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(1675) -const ProxyAgent = __nccwpck_require__(4800) -const Agent = __nccwpck_require__(8717) +const DispatcherBase = __nccwpck_require__(2403) +const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(8705) +const ProxyAgent = __nccwpck_require__(5678) +const Agent = __nccwpck_require__(1891) const DEFAULT_PORTS = { 'http:': 80, @@ -16759,7 +16876,7 @@ module.exports = EnvHttpProxyAgent /***/ }), -/***/ 8692: +/***/ 894: /***/ ((module) => { "use strict"; @@ -16884,16 +17001,16 @@ module.exports = class FixedQueue { /***/ }), -/***/ 2192: +/***/ 7262: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const FixedQueue = __nccwpck_require__(8692) -const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(1675) -const PoolStats = __nccwpck_require__(206) +const DispatcherBase = __nccwpck_require__(2403) +const FixedQueue = __nccwpck_require__(894) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(8705) +const PoolStats = __nccwpck_require__(3264) const kClients = Symbol('clients') const kNeedDrain = Symbol('needDrain') @@ -17086,10 +17203,10 @@ module.exports = { /***/ }), -/***/ 206: +/***/ 3264: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(1675) +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(8705) const kPool = Symbol('pool') class PoolStats { @@ -17127,7 +17244,7 @@ module.exports = PoolStats /***/ }), -/***/ 1748: +/***/ 5326: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -17139,14 +17256,14 @@ const { kNeedDrain, kAddClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Client = __nccwpck_require__(5621) +} = __nccwpck_require__(7262) +const Client = __nccwpck_require__(8223) const { InvalidArgumentError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const buildConnector = __nccwpck_require__(5634) const kOptions = Symbol('options') const kConnections = Symbol('connections') @@ -17242,20 +17359,20 @@ module.exports = Pool /***/ }), -/***/ 4800: +/***/ 5678: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) +const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) const { URL } = __nccwpck_require__(3136) -const Agent = __nccwpck_require__(8717) -const Pool = __nccwpck_require__(1748) -const DispatcherBase = __nccwpck_require__(9921) -const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) -const Client = __nccwpck_require__(5621) +const Agent = __nccwpck_require__(1891) +const Pool = __nccwpck_require__(5326) +const DispatcherBase = __nccwpck_require__(2403) +const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) +const Client = __nccwpck_require__(8223) const kAgent = Symbol('proxy agent') const kClient = Symbol('proxy client') @@ -17524,14 +17641,14 @@ module.exports = ProxyAgent /***/ }), -/***/ 6770: +/***/ 8792: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) -const RetryHandler = __nccwpck_require__(2728) +const Dispatcher = __nccwpck_require__(5353) +const RetryHandler = __nccwpck_require__(8022) class RetryAgent extends Dispatcher { #agent = null @@ -17567,7 +17684,7 @@ module.exports = RetryAgent /***/ }), -/***/ 197: +/***/ 6759: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -17576,8 +17693,8 @@ module.exports = RetryAgent // We include a version number for the Dispatcher API. In case of breaking changes, // this version number must be increased to avoid conflicts. const globalDispatcher = Symbol.for('undici.globalDispatcher.1') -const { InvalidArgumentError } = __nccwpck_require__(9715) -const Agent = __nccwpck_require__(8717) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const Agent = __nccwpck_require__(1891) if (getGlobalDispatcher() === undefined) { setGlobalDispatcher(new Agent()) @@ -17607,7 +17724,7 @@ module.exports = { /***/ }), -/***/ 2587: +/***/ 3253: /***/ ((module) => { "use strict"; @@ -17659,16 +17776,16 @@ module.exports = class DecoratorHandler { /***/ }), -/***/ 5458: +/***/ 9104: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { kBodyUsed } = __nccwpck_require__(1675) +const util = __nccwpck_require__(2250) +const { kBodyUsed } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) -const { InvalidArgumentError } = __nccwpck_require__(9715) +const { InvalidArgumentError } = __nccwpck_require__(7617) const EE = __nccwpck_require__(8474) const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] @@ -17899,21 +18016,21 @@ module.exports = RedirectHandler /***/ }), -/***/ 2728: +/***/ 8022: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kRetryHandlerDefaultRetry } = __nccwpck_require__(1675) -const { RequestRetryError } = __nccwpck_require__(9715) +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(8705) +const { RequestRetryError } = __nccwpck_require__(7617) const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody -} = __nccwpck_require__(3792) +} = __nccwpck_require__(2250) function calculateRetryAfterHeader (retryAfter) { const current = Date.now() @@ -18281,15 +18398,15 @@ module.exports = RetryHandler /***/ }), -/***/ 4411: +/***/ 9765: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { isIP } = __nccwpck_require__(7030) const { lookup } = __nccwpck_require__(610) -const DecoratorHandler = __nccwpck_require__(2587) -const { InvalidArgumentError, InformationalError } = __nccwpck_require__(9715) +const DecoratorHandler = __nccwpck_require__(3253) +const { InvalidArgumentError, InformationalError } = __nccwpck_require__(7617) const maxInt = Math.pow(2, 31) - 1 class DNSInstance { @@ -18664,15 +18781,15 @@ module.exports = interceptorOpts => { /***/ }), -/***/ 4972: +/***/ 6141: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const DecoratorHandler = __nccwpck_require__(2587) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const DecoratorHandler = __nccwpck_require__(3253) class DumpHandler extends DecoratorHandler { #maxSize = 1024 * 1024 @@ -18795,13 +18912,13 @@ module.exports = createDumpInterceptor /***/ }), -/***/ 7780: +/***/ 5914: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { @@ -18824,12 +18941,12 @@ module.exports = createRedirectInterceptor /***/ }), -/***/ 7594: +/***/ 2524: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) module.exports = opts => { const globalMaxRedirections = opts?.maxRedirections @@ -18856,12 +18973,12 @@ module.exports = opts => { /***/ }), -/***/ 9722: +/***/ 2644: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RetryHandler = __nccwpck_require__(2728) +const RetryHandler = __nccwpck_require__(8022) module.exports = globalOpts => { return dispatch => { @@ -18883,14 +19000,14 @@ module.exports = globalOpts => { /***/ }), -/***/ 9368: +/***/ 6882: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; -const utils_1 = __nccwpck_require__(2316); +const utils_1 = __nccwpck_require__(2234); // C headers var ERROR; (function (ERROR) { @@ -19168,7 +19285,7 @@ exports.SPECIAL_HEADERS = { /***/ }), -/***/ 798: +/***/ 4728: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -19181,7 +19298,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 4682: +/***/ 5984: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -19194,7 +19311,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 2316: +/***/ 2234: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -19216,14 +19333,14 @@ exports.enumToMap = enumToMap; /***/ }), -/***/ 8269: +/***/ 3627: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kClients } = __nccwpck_require__(1675) -const Agent = __nccwpck_require__(8717) +const { kClients } = __nccwpck_require__(8705) +const Agent = __nccwpck_require__(1891) const { kAgent, kMockAgentSet, @@ -19234,14 +19351,14 @@ const { kGetNetConnect, kOptions, kFactory -} = __nccwpck_require__(4093) -const MockClient = __nccwpck_require__(4997) -const MockPool = __nccwpck_require__(1828) -const { matchValue, buildMockOptions } = __nccwpck_require__(3589) -const { InvalidArgumentError, UndiciError } = __nccwpck_require__(9715) -const Dispatcher = __nccwpck_require__(6307) -const Pluralizer = __nccwpck_require__(5097) -const PendingInterceptorsFormatter = __nccwpck_require__(9758) +} = __nccwpck_require__(4251) +const MockClient = __nccwpck_require__(3735) +const MockPool = __nccwpck_require__(6134) +const { matchValue, buildMockOptions } = __nccwpck_require__(6031) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(7617) +const Dispatcher = __nccwpck_require__(5353) +const Pluralizer = __nccwpck_require__(1591) +const PendingInterceptorsFormatter = __nccwpck_require__(9236) class MockAgent extends Dispatcher { constructor (opts) { @@ -19384,15 +19501,15 @@ module.exports = MockAgent /***/ }), -/***/ 4997: +/***/ 3735: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Client = __nccwpck_require__(5621) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Client = __nccwpck_require__(8223) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -19401,10 +19518,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockClient provides an API that extends the Client to influence the mockDispatches. @@ -19451,13 +19568,13 @@ module.exports = MockClient /***/ }), -/***/ 93: +/***/ 9539: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { UndiciError } = __nccwpck_require__(9715) +const { UndiciError } = __nccwpck_require__(7617) const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED') @@ -19487,13 +19604,13 @@ module.exports = { /***/ }), -/***/ 6039: +/***/ 3969: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3589) +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kDispatchKey, @@ -19501,9 +19618,9 @@ const { kDefaultTrailers, kContentLength, kMockDispatch -} = __nccwpck_require__(4093) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { buildURL } = __nccwpck_require__(2250) /** * Defines the scope API for an interceptor reply @@ -19702,15 +19819,15 @@ module.exports.MockScope = MockScope /***/ }), -/***/ 1828: +/***/ 6134: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Pool = __nccwpck_require__(1748) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Pool = __nccwpck_require__(5326) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -19719,10 +19836,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockPool provides an API that extends the Pool to influence the mockDispatches. @@ -19769,7 +19886,7 @@ module.exports = MockPool /***/ }), -/***/ 4093: +/***/ 4251: /***/ ((module) => { "use strict"; @@ -19800,21 +19917,21 @@ module.exports = { /***/ }), -/***/ 3589: +/***/ 6031: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { MockNotMatchedError } = __nccwpck_require__(93) +const { MockNotMatchedError } = __nccwpck_require__(9539) const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect -} = __nccwpck_require__(4093) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { buildURL } = __nccwpck_require__(2250) const { STATUS_CODES } = __nccwpck_require__(7067) const { types: { @@ -20175,7 +20292,7 @@ module.exports = { /***/ }), -/***/ 9758: +/***/ 9236: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -20226,7 +20343,7 @@ module.exports = class PendingInterceptorsFormatter { /***/ }), -/***/ 5097: +/***/ 1591: /***/ ((module) => { "use strict"; @@ -20263,7 +20380,7 @@ module.exports = class Pluralizer { /***/ }), -/***/ 1915: +/***/ 2841: /***/ ((module) => { "use strict"; @@ -20694,21 +20811,21 @@ module.exports = { /***/ }), -/***/ 5714: +/***/ 9556: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { urlEquals, getFieldValues } = __nccwpck_require__(8094) -const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3792) -const { webidl } = __nccwpck_require__(613) -const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(2603) -const { Request, fromInnerRequest } = __nccwpck_require__(6607) -const { kState } = __nccwpck_require__(2043) -const { fetching } = __nccwpck_require__(782) -const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9808) +const { kConstruct } = __nccwpck_require__(4527) +const { urlEquals, getFieldValues } = __nccwpck_require__(7900) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(2250) +const { webidl } = __nccwpck_require__(4195) +const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(5093) +const { Request, fromInnerRequest } = __nccwpck_require__(2257) +const { kState } = __nccwpck_require__(4701) +const { fetching } = __nccwpck_require__(5404) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9614) const assert = __nccwpck_require__(4589) /** @@ -21561,16 +21678,16 @@ module.exports = { /***/ }), -/***/ 8733: +/***/ 2363: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { Cache } = __nccwpck_require__(5714) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(4527) +const { Cache } = __nccwpck_require__(9556) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class CacheStorage { /** @@ -21721,28 +21838,28 @@ module.exports = { /***/ }), -/***/ 2045: +/***/ 4527: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - kConstruct: (__nccwpck_require__(1675).kConstruct) + kConstruct: (__nccwpck_require__(8705).kConstruct) } /***/ }), -/***/ 8094: +/***/ 7900: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { URLSerializer } = __nccwpck_require__(8828) -const { isValidHeaderName } = __nccwpck_require__(9808) +const { URLSerializer } = __nccwpck_require__(4622) +const { isValidHeaderName } = __nccwpck_require__(9614) /** * @see https://url.spec.whatwg.org/#concept-url-equals @@ -21787,7 +21904,7 @@ module.exports = { /***/ }), -/***/ 924: +/***/ 8498: /***/ ((module) => { "use strict"; @@ -21807,16 +21924,16 @@ module.exports = { /***/ }), -/***/ 1973: +/***/ 6783: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { parseSetCookie } = __nccwpck_require__(3498) -const { stringify } = __nccwpck_require__(4533) -const { webidl } = __nccwpck_require__(613) -const { Headers } = __nccwpck_require__(6548) +const { parseSetCookie } = __nccwpck_require__(9032) +const { stringify } = __nccwpck_require__(6095) +const { webidl } = __nccwpck_require__(4195) +const { Headers } = __nccwpck_require__(4478) /** * @typedef {Object} Cookie @@ -21999,15 +22116,15 @@ module.exports = { /***/ }), -/***/ 3498: +/***/ 9032: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(924) -const { isCTLExcludingHtab } = __nccwpck_require__(4533) -const { collectASequenceOfCodePointsFast } = __nccwpck_require__(8828) +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(8498) +const { isCTLExcludingHtab } = __nccwpck_require__(6095) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4622) const assert = __nccwpck_require__(4589) /** @@ -22280,32 +22397,25 @@ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) // If the attribute-name case-insensitively matches the string // "SameSite", the user agent MUST process the cookie-av as follows: - // 1. Let enforcement be "Default". - let enforcement = 'Default' - const attributeValueLowercase = attributeValue.toLowerCase() - // 2. If cookie-av's attribute-value is a case-insensitive match for - // "None", set enforcement to "None". - if (attributeValueLowercase.includes('none')) { - enforcement = 'None' - } - - // 3. If cookie-av's attribute-value is a case-insensitive match for - // "Strict", set enforcement to "Strict". - if (attributeValueLowercase.includes('strict')) { - enforcement = 'Strict' - } - // 4. If cookie-av's attribute-value is a case-insensitive match for - // "Lax", set enforcement to "Lax". - if (attributeValueLowercase.includes('lax')) { - enforcement = 'Lax' + // 1. If cookie-av's attribute-value is a case-insensitive match for + // "None", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "None". + if (attributeValueLowercase === 'none') { + cookieAttributeList.sameSite = 'None' + } else if (attributeValueLowercase === 'strict') { + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", append an attribute to the cookie-attribute-list with + // an attribute-name of "SameSite" and an attribute-value of + // "Strict". + cookieAttributeList.sameSite = 'Strict' + } else if (attributeValueLowercase === 'lax') { + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "Lax". + cookieAttributeList.sameSite = 'Lax' } - - // 5. Append an attribute to the cookie-attribute-list with an - // attribute-name of "SameSite" and an attribute-value of - // enforcement. - cookieAttributeList.sameSite = enforcement } else { cookieAttributeList.unparsed ??= [] @@ -22324,7 +22434,7 @@ module.exports = { /***/ }), -/***/ 4533: +/***/ 6095: /***/ ((module) => { "use strict"; @@ -22614,13 +22724,13 @@ module.exports = { /***/ }), -/***/ 8735: +/***/ 1581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Transform } = __nccwpck_require__(7075) -const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(3867) +const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5537) /** * @type {number[]} BOM @@ -23020,23 +23130,23 @@ module.exports = { /***/ }), -/***/ 4886: +/***/ 5768: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { pipeline } = __nccwpck_require__(7075) -const { fetching } = __nccwpck_require__(782) -const { makeRequest } = __nccwpck_require__(6607) -const { webidl } = __nccwpck_require__(613) -const { EventSourceStream } = __nccwpck_require__(8735) -const { parseMIMEType } = __nccwpck_require__(8828) -const { createFastMessageEvent } = __nccwpck_require__(8916) -const { isNetworkError } = __nccwpck_require__(2603) -const { delay } = __nccwpck_require__(3867) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { environmentSettingsObject } = __nccwpck_require__(9808) +const { fetching } = __nccwpck_require__(5404) +const { makeRequest } = __nccwpck_require__(2257) +const { webidl } = __nccwpck_require__(4195) +const { EventSourceStream } = __nccwpck_require__(1581) +const { parseMIMEType } = __nccwpck_require__(4622) +const { createFastMessageEvent } = __nccwpck_require__(4926) +const { isNetworkError } = __nccwpck_require__(5093) +const { delay } = __nccwpck_require__(5537) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { environmentSettingsObject } = __nccwpck_require__(9614) let experimentalWarned = false @@ -23508,7 +23618,7 @@ module.exports = { /***/ }), -/***/ 3867: +/***/ 5537: /***/ ((module) => { "use strict"; @@ -23553,13 +23663,13 @@ module.exports = { /***/ }), -/***/ 220: +/***/ 3682: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { ReadableStreamFrom, isBlobLike, @@ -23569,16 +23679,16 @@ const { fullyReadBody, extractMimeType, utf8DecodeBytes -} = __nccwpck_require__(9808) -const { FormData } = __nccwpck_require__(2198) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { FormData } = __nccwpck_require__(7064) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) const { Blob } = __nccwpck_require__(4573) const assert = __nccwpck_require__(4589) const { isErrored, isDisturbed } = __nccwpck_require__(7075) const { isArrayBuffer } = __nccwpck_require__(3429) -const { serializeAMimeType } = __nccwpck_require__(8828) -const { multipartFormDataParser } = __nccwpck_require__(6052) +const { serializeAMimeType } = __nccwpck_require__(4622) +const { multipartFormDataParser } = __nccwpck_require__(5670) let random try { @@ -24090,7 +24200,7 @@ module.exports = { /***/ }), -/***/ 1935: +/***/ 3169: /***/ ((module) => { "use strict"; @@ -24222,7 +24332,7 @@ module.exports = { /***/ }), -/***/ 8828: +/***/ 4622: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -24974,13 +25084,13 @@ module.exports = { /***/ }), -/***/ 125: +/***/ 3207: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConnected, kSize } = __nccwpck_require__(1675) +const { kConnected, kSize } = __nccwpck_require__(8705) class CompatWeakRef { constructor (value) { @@ -25028,15 +25138,15 @@ module.exports = function () { /***/ }), -/***/ 8250: +/***/ 4052: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Blob, File } = __nccwpck_require__(4573) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) // TODO(@KhafraDev): remove class FileLike { @@ -25162,17 +25272,17 @@ module.exports = { FileLike, isFileLike } /***/ }), -/***/ 6052: +/***/ 5670: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { utf8DecodeBytes } = __nccwpck_require__(9808) -const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(8828) -const { isFileLike } = __nccwpck_require__(8250) -const { makeEntry } = __nccwpck_require__(2198) +const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { utf8DecodeBytes } = __nccwpck_require__(9614) +const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(4622) +const { isFileLike } = __nccwpck_require__(4052) +const { makeEntry } = __nccwpck_require__(7064) const assert = __nccwpck_require__(4589) const { File: NodeFile } = __nccwpck_require__(4573) @@ -25644,17 +25754,17 @@ module.exports = { /***/ }), -/***/ 2198: +/***/ 7064: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isBlobLike, iteratorMixin } = __nccwpck_require__(9808) -const { kState } = __nccwpck_require__(2043) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { FileLike, isFileLike } = __nccwpck_require__(8250) -const { webidl } = __nccwpck_require__(613) +const { isBlobLike, iteratorMixin } = __nccwpck_require__(9614) +const { kState } = __nccwpck_require__(4701) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { FileLike, isFileLike } = __nccwpck_require__(4052) +const { webidl } = __nccwpck_require__(4195) const { File: NativeFile } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) @@ -25904,7 +26014,7 @@ module.exports = { FormData, makeEntry } /***/ }), -/***/ 5699: +/***/ 7573: /***/ ((module) => { "use strict"; @@ -25952,7 +26062,7 @@ module.exports = { /***/ }), -/***/ 6548: +/***/ 4478: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -25960,14 +26070,14 @@ module.exports = { -const { kConstruct } = __nccwpck_require__(1675) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(8705) +const { kEnumerableProperty } = __nccwpck_require__(2250) const { iteratorMixin, isValidHeaderName, isValidHeaderValue -} = __nccwpck_require__(9808) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { webidl } = __nccwpck_require__(4195) const assert = __nccwpck_require__(4589) const util = __nccwpck_require__(7975) @@ -26647,7 +26757,7 @@ module.exports = { /***/ }), -/***/ 782: +/***/ 5404: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -26661,9 +26771,9 @@ const { filterResponse, makeResponse, fromInnerResponse -} = __nccwpck_require__(2603) -const { HeadersList } = __nccwpck_require__(6548) -const { Request, cloneRequest } = __nccwpck_require__(6607) +} = __nccwpck_require__(5093) +const { HeadersList } = __nccwpck_require__(4478) +const { Request, cloneRequest } = __nccwpck_require__(2257) const zlib = __nccwpck_require__(8522) const { bytesMatch, @@ -26699,23 +26809,23 @@ const { buildContentRange, createInflate, extractMimeType -} = __nccwpck_require__(9808) -const { kState, kDispatcher } = __nccwpck_require__(2043) +} = __nccwpck_require__(9614) +const { kState, kDispatcher } = __nccwpck_require__(4701) const assert = __nccwpck_require__(4589) -const { safelyExtractBody, extractBody } = __nccwpck_require__(220) +const { safelyExtractBody, extractBody } = __nccwpck_require__(3682) const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const EE = __nccwpck_require__(8474) const { Readable, pipeline, finished } = __nccwpck_require__(7075) -const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(8828) -const { getGlobalDispatcher } = __nccwpck_require__(197) -const { webidl } = __nccwpck_require__(613) +const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(4622) +const { getGlobalDispatcher } = __nccwpck_require__(6759) +const { webidl } = __nccwpck_require__(4195) const { STATUS_CODES } = __nccwpck_require__(7067) const GET_OR_HEAD = ['GET', 'HEAD'] @@ -28927,7 +29037,7 @@ module.exports = { /***/ }), -/***/ 6607: +/***/ 2257: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -28935,16 +29045,16 @@ module.exports = { -const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(220) -const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(6548) -const { FinalizationRegistry } = __nccwpck_require__(125)() -const util = __nccwpck_require__(3792) +const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(3682) +const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(4478) +const { FinalizationRegistry } = __nccwpck_require__(3207)() +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { isValidHTTPToken, sameOrigin, environmentSettingsObject -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { forbiddenMethodsSet, corsSafeListedMethodsSet, @@ -28954,12 +29064,12 @@ const { requestCredentials, requestCache, requestDuplex -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util -const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474) @@ -29972,15 +30082,15 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest } /***/ }), -/***/ 2603: +/***/ 5093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(6548) -const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(220) -const util = __nccwpck_require__(3792) +const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(4478) +const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(3682) +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { kEnumerableProperty } = util const { @@ -29992,16 +30102,16 @@ const { isErrorLike, isomorphicEncode, environmentSettingsObject: relevantRealm -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { redirectStatusSet, nullBodyStatus -} = __nccwpck_require__(1935) -const { kState, kHeaders } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { FormData } = __nccwpck_require__(2198) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +} = __nccwpck_require__(3169) +const { kState, kHeaders } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { FormData } = __nccwpck_require__(7064) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { types } = __nccwpck_require__(7975) @@ -30590,7 +30700,7 @@ module.exports = { /***/ }), -/***/ 2043: +/***/ 4701: /***/ ((module) => { "use strict"; @@ -30607,7 +30717,7 @@ module.exports = { /***/ }), -/***/ 9808: +/***/ 9614: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -30615,14 +30725,14 @@ module.exports = { const { Transform } = __nccwpck_require__(7075) const zlib = __nccwpck_require__(8522) -const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1935) -const { getGlobalOrigin } = __nccwpck_require__(5699) -const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(8828) +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(3169) +const { getGlobalOrigin } = __nccwpck_require__(7573) +const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(4622) const { performance } = __nccwpck_require__(643) -const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3792) +const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(2250) const assert = __nccwpck_require__(4589) const { isUint8Array } = __nccwpck_require__(3429) -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) let supportedHashes = [] @@ -32247,7 +32357,7 @@ module.exports = { /***/ }), -/***/ 613: +/***/ 4195: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -32255,7 +32365,7 @@ module.exports = { const { types, inspect } = __nccwpck_require__(7975) const { markAsUncloneable } = __nccwpck_require__(5919) -const { toUSVString } = __nccwpck_require__(3792) +const { toUSVString } = __nccwpck_require__(2250) /** @type {import('../../../types/webidl').Webidl} */ const webidl = {} @@ -32950,7 +33060,7 @@ module.exports = { /***/ }), -/***/ 9919: +/***/ 7261: /***/ ((module) => { "use strict"; @@ -33248,7 +33358,7 @@ module.exports = { /***/ }), -/***/ 9395: +/***/ 6705: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -33258,16 +33368,16 @@ const { staticPropertyDescriptors, readOperation, fireAProgressEvent -} = __nccwpck_require__(3738) +} = __nccwpck_require__(6532) const { kState, kError, kResult, kEvents, kAborted -} = __nccwpck_require__(2913) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +} = __nccwpck_require__(9671) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class FileReader extends EventTarget { constructor () { @@ -33600,13 +33710,13 @@ module.exports = { /***/ }), -/***/ 7101: +/***/ 8731: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) const kState = Symbol('ProgressEvent state') @@ -33686,7 +33796,7 @@ module.exports = { /***/ }), -/***/ 2913: +/***/ 9671: /***/ ((module) => { "use strict"; @@ -33704,7 +33814,7 @@ module.exports = { /***/ }), -/***/ 3738: +/***/ 6532: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -33716,10 +33826,10 @@ const { kResult, kAborted, kLastProgressEventFired -} = __nccwpck_require__(2913) -const { ProgressEvent } = __nccwpck_require__(7101) -const { getEncoding } = __nccwpck_require__(9919) -const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(8828) +} = __nccwpck_require__(9671) +const { ProgressEvent } = __nccwpck_require__(8731) +const { getEncoding } = __nccwpck_require__(7261) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4622) const { types } = __nccwpck_require__(7975) const { StringDecoder } = __nccwpck_require__(3193) const { btoa } = __nccwpck_require__(4573) @@ -34103,28 +34213,28 @@ module.exports = { /***/ }), -/***/ 737: +/***/ 2379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(2512) +const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(362) const { kReadyState, kSentClose, kByteParser, kReceivedClose, kResponse -} = __nccwpck_require__(9360) -const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(4081) -const { channels } = __nccwpck_require__(7822) -const { CloseEvent } = __nccwpck_require__(8916) -const { makeRequest } = __nccwpck_require__(6607) -const { fetching } = __nccwpck_require__(782) -const { Headers, getHeadersList } = __nccwpck_require__(6548) -const { getDecodeSplit } = __nccwpck_require__(9808) -const { WebsocketFrameSend } = __nccwpck_require__(2928) +} = __nccwpck_require__(6858) +const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(343) +const { channels } = __nccwpck_require__(6692) +const { CloseEvent } = __nccwpck_require__(4926) +const { makeRequest } = __nccwpck_require__(2257) +const { fetching } = __nccwpck_require__(5404) +const { Headers, getHeadersList } = __nccwpck_require__(4478) +const { getDecodeSplit } = __nccwpck_require__(9614) +const { WebsocketFrameSend } = __nccwpck_require__(9506) /** @type {import('crypto')} */ let crypto @@ -34482,7 +34592,7 @@ module.exports = { /***/ }), -/***/ 2512: +/***/ 362: /***/ ((module) => { "use strict"; @@ -34556,15 +34666,15 @@ module.exports = { /***/ }), -/***/ 8916: +/***/ 4926: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { kConstruct } = __nccwpck_require__(1675) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { kConstruct } = __nccwpck_require__(8705) const { MessagePort } = __nccwpck_require__(5919) /** @@ -34893,13 +35003,13 @@ module.exports = { /***/ }), -/***/ 2928: +/***/ 9506: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxUnsigned16Bit } = __nccwpck_require__(2512) +const { maxUnsigned16Bit } = __nccwpck_require__(362) const BUFFER_SIZE = 16386 @@ -34997,15 +35107,15 @@ module.exports = { /***/ }), -/***/ 477: +/***/ 1087: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522) -const { isValidClientWindowBits } = __nccwpck_require__(4081) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +const { isValidClientWindowBits } = __nccwpck_require__(343) +const { MessageSizeExceededError } = __nccwpck_require__(7617) const tail = Buffer.from([0x00, 0x00, 0xff, 0xff]) const kBuffer = Symbol('kBuffer') @@ -35105,7 +35215,7 @@ module.exports = { PerMessageDeflate } /***/ }), -/***/ 148: +/***/ 4658: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -35113,9 +35223,9 @@ module.exports = { PerMessageDeflate } const { Writable } = __nccwpck_require__(7075) const assert = __nccwpck_require__(4589) -const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(2512) -const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(9360) -const { channels } = __nccwpck_require__(7822) +const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(362) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(6858) +const { channels } = __nccwpck_require__(6692) const { isValidStatusCode, isValidOpcode, @@ -35125,11 +35235,16 @@ const { isControlFrame, isTextBinaryFrame, isContinuationFrame -} = __nccwpck_require__(4081) -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { closeWebSocketConnection } = __nccwpck_require__(737) -const { PerMessageDeflate } = __nccwpck_require__(477) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +} = __nccwpck_require__(343) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { closeWebSocketConnection } = __nccwpck_require__(2379) +const { PerMessageDeflate } = __nccwpck_require__(1087) +const { MessageSizeExceededError } = __nccwpck_require__(7617) + +function failWebsocketConnectionWithCode (ws, code, reason) { + closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason)) + failWebsocketConnection(ws, reason) +} // This code was influenced by ws released under the MIT license. // Copyright (c) 2011 Einar Otto Stangvik @@ -35150,19 +35265,23 @@ class ByteParser extends Writable { /** @type {Map} */ #extensions + /** @type {number} */ + #maxFragments + /** @type {number} */ #maxPayloadSize /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions - * @param {{ maxPayloadSize?: number }} [options] + * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options] */ constructor (ws, extensions, options = {}) { super() this.ws = ws this.#extensions = extensions == null ? new Map() : extensions + this.#maxFragments = options.maxFragments ?? 0 this.#maxPayloadSize = options.maxPayloadSize ?? 0 if (this.#extensions.has('permessage-deflate')) { @@ -35186,9 +35305,9 @@ class ByteParser extends Writable { if ( this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && - this.#info.payloadLength > this.#maxPayloadSize + this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize ) { - failWebsocketConnection(this.ws, 'Payload size exceeds maximum allowed size') + failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size') return false } @@ -35353,10 +35472,12 @@ class ByteParser extends Writable { this.#state = parserStates.INFO } else { if (!this.#info.compressed) { - this.writeFragments(body) + if (!this.writeFragments(body)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -35375,14 +35496,17 @@ class ByteParser extends Writable { this.#info.fin, (error, data) => { if (error) { - failWebsocketConnection(this.ws, error.message) + const code = error instanceof MessageSizeExceededError ? 1009 : 1007 + failWebsocketConnectionWithCode(this.ws, code, error.message) return } - this.writeFragments(data) + if (!this.writeFragments(data)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -35452,8 +35576,17 @@ class ByteParser extends Writable { } writeFragments (fragment) { + if ( + this.#maxFragments > 0 && + this.#fragments.length === this.#maxFragments + ) { + failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments') + return false + } + this.#fragmentsBytes += fragment.length this.#fragments.push(fragment) + return true } consumeFragments () { @@ -35603,15 +35736,15 @@ module.exports = { /***/ }), -/***/ 5164: +/***/ 7526: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { opcodes, sendHints } = __nccwpck_require__(2512) -const FixedQueue = __nccwpck_require__(8692) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { opcodes, sendHints } = __nccwpck_require__(362) +const FixedQueue = __nccwpck_require__(894) /** @type {typeof Uint8Array} */ const FastBuffer = Buffer[Symbol.species] @@ -35715,7 +35848,7 @@ module.exports = { SendQueue } /***/ }), -/***/ 9360: +/***/ 6858: /***/ ((module) => { "use strict"; @@ -35735,17 +35868,17 @@ module.exports = { /***/ }), -/***/ 4081: +/***/ 343: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(9360) -const { states, opcodes } = __nccwpck_require__(2512) -const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(8916) +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(6858) +const { states, opcodes } = __nccwpck_require__(362) +const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(4926) const { isUtf8 } = __nccwpck_require__(4573) -const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(8828) +const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(4622) /* globals Blob */ @@ -36065,16 +36198,16 @@ module.exports = { /***/ }), -/***/ 5134: +/***/ 9480: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { environmentSettingsObject } = __nccwpck_require__(9808) -const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(2512) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { environmentSettingsObject } = __nccwpck_require__(9614) +const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(362) const { kWebSocketURL, kReadyState, @@ -36083,21 +36216,21 @@ const { kResponse, kSentClose, kByteParser -} = __nccwpck_require__(9360) +} = __nccwpck_require__(6858) const { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent -} = __nccwpck_require__(4081) -const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(737) -const { ByteParser } = __nccwpck_require__(148) -const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3792) -const { getGlobalDispatcher } = __nccwpck_require__(197) +} = __nccwpck_require__(343) +const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(2379) +const { ByteParser } = __nccwpck_require__(4658) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(2250) +const { getGlobalDispatcher } = __nccwpck_require__(6759) const { types } = __nccwpck_require__(7975) -const { ErrorEvent, CloseEvent } = __nccwpck_require__(8916) -const { SendQueue } = __nccwpck_require__(5164) +const { ErrorEvent, CloseEvent } = __nccwpck_require__(4926) +const { SendQueue } = __nccwpck_require__(7526) // https://websockets.spec.whatwg.org/#interface-definition class WebSocket extends EventTarget { @@ -36506,9 +36639,12 @@ class WebSocket extends EventTarget { // once this happens, the connection is open this[kResponse] = response - const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize + const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions + const maxFragments = webSocketOptions?.maxFragments + const maxPayloadSize = webSocketOptions?.maxPayloadSize const parser = new ByteParser(this, parsedExtensions, { + maxFragments, maxPayloadSize }) parser.on('drain', onParserDrain) @@ -37424,11 +37560,11 @@ function qstring(str) { /***/ }), -/***/ 9499: +/***/ 3117: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/*! Axios v1.16.1 Copyright (c) 2026 Matt Zabriskie and contributors */ +/*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors */ var FormData$1 = __nccwpck_require__(6942); @@ -37470,6 +37606,52 @@ const { iterator, toStringTag } = Symbol; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({ + hasOwnProperty +}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Walk the prototype chain (excluding the shared Object.prototype) looking for + * an own `prop`. This distinguishes genuine own/inherited members — including + * class accessors and template prototypes — from members injected via + * Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which + * live on Object.prototype itself and are therefore never matched. + * + * @param {*} thing The value whose chain to inspect + * @param {string|symbol} prop The property key to look for + * + * @returns {boolean} True when `prop` is owned below Object.prototype + */ +const hasOwnInPrototypeChain = (thing, prop) => { + let obj = thing; + const seen = []; + while (obj != null && obj !== Object.prototype) { + if (seen.indexOf(obj) !== -1) { + return false; + } + seen.push(obj); + if (hasOwnProperty(obj, prop)) { + return true; + } + obj = getPrototypeOf(obj); + } + return false; +}; + +/** + * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own + * properties and members inherited from a non-Object.prototype source (a class + * instance or template object) are honored; a value reachable only through a + * polluted Object.prototype is ignored and `undefined` is returned. + * + * @param {*} obj The source object + * @param {string|symbol} prop The property key to read + * + * @returns {*} The resolved value, or undefined when unsafe/absent + */ +const getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined; const kindOf = (cache => thing => { const str = toString.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); @@ -37588,11 +37770,15 @@ const isBoolean = thing => thing === true || thing === false; * @returns {boolean} True if value is a plain Object, otherwise false */ const isPlainObject = val => { - if (kindOf(val) !== 'object') { + if (!isObject(val)) { return false; } const prototype = getPrototypeOf(val); - return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); + return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) && + // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or + // Symbol.iterator as evidence the value is a tagged/iterable type rather + // than a plain object, while ignoring keys injected onto Object.prototype. + !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator); }; /** @@ -37675,6 +37861,7 @@ const isBlob = kindOfTest('Blob'); * @returns {boolean} True if value is a FileList, otherwise false */ const isFileList = kindOfTest('FileList'); +const isSet = kindOfTest('Set'); /** * Determine if a value is a Stream @@ -37847,7 +38034,10 @@ function merge(...objs) { if (key === '__proto__' || key === 'constructor' || key === 'prototype') { return; } - const targetKey = caseless && findKey(result, key) || key; + + // findKey lowercases the key, so caseless lookup only applies to strings — + // symbol keys are identity-matched. + const targetKey = caseless && typeof key === 'string' && findKey(result, key) || key; // Read via own-prop only — a bare `result[targetKey]` walks the prototype // chain, so a polluted Object.prototype value could surface here and get // copied into the merged result. @@ -37863,7 +38053,21 @@ function merge(...objs) { } }; for (let i = 0, l = objs.length; i < l; i++) { - objs[i] && forEach(objs[i], assignValue); + const source = objs[i]; + if (!source || isBuffer(source)) { + continue; + } + forEach(source, assignValue); + if (typeof source !== 'object' || isArray(source)) { + continue; + } + const symbols = Object.getOwnPropertySymbols(source); + for (let j = 0; j < symbols.length; j++) { + const symbol = symbols[j]; + if (propertyIsEnumerable.call(source, symbol)) { + assignValue(source[symbol], symbol); + } + } } return result; } @@ -38075,11 +38279,9 @@ const toCamelCase = str => { return p1.toUpperCase() + p2; }); }; - -/* Creating a function that will check if an object has a property. */ -const hasOwnProperty = (({ - hasOwnProperty -}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); +const { + propertyIsEnumerable +} = Object.prototype; /** * Determine if a value is a RegExp object @@ -38182,11 +38384,20 @@ const toJSONObject = obj => { if (!('toJSON' in source)) { // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230). visited.add(source); - const target = isArray(source) ? [] : {}; - forEach(source, (value, key) => { - const reducedValue = visit(value); - !isUndefined(reducedValue) && (target[key] = reducedValue); - }); + let target; + if (isSet(source)) { + target = []; + for (const value of source) { + const reducedValue = visit(value); + !isUndefined(reducedValue) && target.push(reducedValue); + } + } else { + target = isArray(source) ? [] : {}; + forEach(source, (value, key) => { + const reducedValue = visit(value); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + } visited.delete(source); return target; } @@ -38254,6 +38465,19 @@ const asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global // ********************* const isIterable = thing => thing != null && isFunction$1(thing[iterator]); + +/** + * Determine if a value is iterable via an iterator that is NOT sourced solely + * from a polluted Object.prototype. Use this instead of `isIterable` whenever + * the iterable comes from untrusted input (e.g. user-supplied header sources), + * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object + * into an attacker-controlled entries iterator. + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value has a non-polluted iterator + */ +const isSafeIterable = thing => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing); var utils$1 = { isArray, isArrayBuffer, @@ -38299,6 +38523,8 @@ var utils$1 = { hasOwnProperty, hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + hasOwnInPrototypeChain, + getSafeProp, reduceDescriptors, freezeMethods, toObjectSet, @@ -38314,7 +38540,8 @@ var utils$1 = { isThenable, setImmediate: _setImmediate, asap, - isIterable + isIterable, + isSafeIterable }; // RawAxiosHeaders whose duplicates are ignored by node @@ -38344,17 +38571,18 @@ var parseHeaders = rawHeaders => { i = line.indexOf(':'); key = line.substring(0, i).trim().toLowerCase(); val = line.substring(i + 1).trim(); - if (!key || parsed[key] && ignoreDuplicateOf[key]) { + const hasKey = utils$1.hasOwnProp(parsed, key); + if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) { return; } if (key === 'set-cookie') { - if (parsed[key]) { + if (hasKey) { parsed[key].push(val); } else { parsed[key] = [val]; } } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + parsed[key] = hasKey ? parsed[key] + ', ' + val : val; } }); return parsed; @@ -38420,6 +38648,90 @@ function parseTokens(str) { } return tokens; } +const parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; +function trimOWS(value) { + let start = 0; + let end = value.length; + while (start < end) { + const code = value.charCodeAt(start); + if (code !== 0x09 && code !== 0x20) { + break; + } + start += 1; + } + while (end > start) { + const code = value.charCodeAt(end - 1); + if (code !== 0x09 && code !== 0x20) { + break; + } + end -= 1; + } + return start === 0 && end === value.length ? value : value.slice(start, end); +} +function decodeQuotedString(value) { + const last = value.length - 1; + if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) { + return value; + } + let decoded = ''; + for (let i = 1; i < last; i++) { + const code = value.charCodeAt(i); + if (code === 0x22) { + return value; + } + if (code === 0x5c) { + i += 1; + if (i >= last) { + return value; + } + } + decoded += value[i]; + } + return decoded; +} +function parseParameters(value) { + const parameters = Object.create(null); + const str = String(value); + let start = 0; + let quoted = false; + let escaped = false; + function parseParameter(end) { + const part = trimOWS(str.slice(start, end)); + const equals = part.indexOf('='); + if (equals < 1) { + return; + } + const name = trimOWS(part.slice(0, equals)); + if (!parameterNameRE.test(name)) { + return; + } + const normalizedName = name.toLowerCase(); + if (normalizedName === '__proto__' || normalizedName === 'constructor' || normalizedName === 'prototype') { + return; + } + const parameterValue = trimOWS(part.slice(equals + 1)); + parameters[normalizedName] = decodeQuotedString(parameterValue); + } + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + if (quoted) { + if (escaped) { + escaped = false; + } else if (code === 0x5c) { + escaped = true; + } else if (code === 0x22) { + quoted = false; + } + } else if (code === 0x22) { + quoted = true; + } else if (code === 0x2c || code === 0x3b) { + parseParameter(i); + start = i + 1; + } + } + parseParameter(str.length); + return parameters; +} const isValidHeaderName = str => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { if (utils$1.isFunction(filter)) { @@ -38464,7 +38776,7 @@ class AxiosHeaders { function setHeader(_value, _header, _rewrite) { const lHeader = normalizeHeader(_header); if (!lHeader) { - throw new Error('header name must be a non-empty string'); + return; } const key = utils$1.findKey(self, lHeader); if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) { @@ -38476,15 +38788,21 @@ class AxiosHeaders { setHeaders(header, valueOrRewrite); } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { setHeaders(parseHeaders(header), valueOrRewrite); - } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { - let obj = {}, + } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) { + let obj = Object.create(null), dest, key; for (const entry of header) { if (!utils$1.isArray(entry)) { - throw TypeError('Object iterator must return a key-value pair'); + throw new TypeError('Object iterator must return a key-value pair'); + } + key = entry[0]; + if (utils$1.hasOwnProp(obj, key)) { + dest = obj[key]; + obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]; + } else { + obj[key] = entry[1]; } - obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; } setHeaders(obj, valueOrRewrite); } else { @@ -38591,7 +38909,8 @@ class AxiosHeaders { return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); } getSetCookie() { - return this.get('set-cookie') || []; + const value = this.get('set-cookie'); + return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value]; } get [Symbol.toStringTag]() { return 'AxiosHeaders'; @@ -38599,6 +38918,9 @@ class AxiosHeaders { static from(thing) { return thing instanceof this ? thing : new this(thing); } + static parseParameters(value) { + return parseParameters(value); + } static concat(first, ...targets) { const computed = new this(first); targets.forEach(target => computed.set(target)); @@ -38693,10 +39015,46 @@ function redactConfig(config, redactKeys) { }; return visit(config); } +function stringifySafely$1(value) { + try { + return String(value); + } catch (err) { + return ''; + } +} +function aggregateErrorMessage(error) { + const message = error.errors.map(entry => { + try { + return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry); + } catch (err) { + return ''; + } + }).filter(Boolean).join('; '); + return message || error.name || 'AggregateError'; +} class AxiosError extends Error { static from(error, code, config, request, response, customProps) { - const axiosError = new AxiosError(error.message, code || error.code, config, request, response); - axiosError.cause = error; + // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection + // failures) has an empty `message`; its detail lives in `errors[]`. Without + // this, the wrapped error surfaces with a blank message (see #6721). + let message = error.message; + if (!message && utils$1.isArray(error.errors) && error.errors.length) { + message = aggregateErrorMessage(error); + } + const axiosError = new AxiosError(message, code || error.code, config, request, response); + // Match native `Error` `cause` semantics: non-enumerable. The wrapped + // error often carries circular internals (sockets, requests, agents), so + // an enumerable `cause` makes structured loggers (pino/winston) and any + // own-property walk throw "Converting circular structure to JSON". + // Regression from #6982; see #7205. `__proto__: null` mirrors the + // `message` descriptor below (prototype-pollution-safe descriptor). + Object.defineProperty(axiosError, 'cause', { + __proto__: null, + value: error, + writable: true, + enumerable: false, + configurable: true + }); axiosError.name = error.name; // Preserve status from the original error if not already set from response @@ -38787,6 +39145,19 @@ AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT'; AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL'; AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED'; +var PlatformBuffer = { + isBufferAvailable() { + return typeof Buffer !== 'undefined'; + }, + from(value) { + return Buffer.from(value); + } +}; + +// Default nesting limit shared with the inverse transform (formDataToJSON) so +// the FormData <-> JSON round-trip stays symmetric. +const DEFAULT_FORM_DATA_MAX_DEPTH = 100; + /** * Determines if the given thing is a array or js object. * @@ -38887,8 +39258,9 @@ function toFormData(obj, formData, options) { const dots = options.dots; const indexes = options.indexes; const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; - const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth; + const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth; const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + const stack = []; if (!utils$1.isFunction(visitor)) { throw new TypeError('visitor must be a function'); } @@ -38904,10 +39276,38 @@ function toFormData(obj, formData, options) { throw new AxiosError('Blob is not supported. Use a Buffer instead.'); } if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { - return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + if (useBlob && typeof _Blob === 'function') { + return new _Blob([value]); + } + if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) { + return PlatformBuffer.from(value); + } + throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT); } return value; } + function throwIfMaxDepthExceeded(depth) { + if (depth > maxDepth) { + throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); + } + } + function stringifyWithDepthLimit(value, depth) { + if (maxDepth === Infinity) { + return JSON.stringify(value); + } + const ancestors = []; + return JSON.stringify(value, function limitDepth(_key, currentValue) { + if (!utils$1.isObject(currentValue)) { + return currentValue; + } + while (ancestors.length && ancestors[ancestors.length - 1] !== this) { + ancestors.pop(); + } + ancestors.push(currentValue); + throwIfMaxDepthExceeded(depth + ancestors.length - 1); + return currentValue; + }); + } /** * Default visitor. @@ -38930,7 +39330,7 @@ function toFormData(obj, formData, options) { // eslint-disable-next-line no-param-reassign key = metaTokens ? key : key.slice(0, -2); // eslint-disable-next-line no-param-reassign - value = JSON.stringify(value); + value = stringifyWithDepthLimit(value, 1); } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) { // eslint-disable-next-line no-param-reassign key = removeBrackets(key); @@ -38948,7 +39348,6 @@ function toFormData(obj, formData, options) { formData.append(renderKey(path, key, dots), convertValue(value)); return false; } - const stack = []; const exposedHelpers = Object.assign(predicates, { defaultVisitor, convertValue, @@ -38956,11 +39355,9 @@ function toFormData(obj, formData, options) { }); function build(value, path, depth = 0) { if (utils$1.isUndefined(value)) return; - if (depth > maxDepth) { - throw new AxiosError('Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); - } + throwIfMaxDepthExceeded(depth); if (stack.indexOf(value) !== -1) { - throw Error('Circular reference detected in ' + path.join('.')); + throw new Error('Circular reference detected in ' + path.join('.')); } stack.push(value); utils$1.forEach(value, function each(el, key) { @@ -39017,9 +39414,7 @@ prototype.append = function append(name, value) { this._pairs.push([name, value]); }; prototype.toString = function toString(encoder) { - const _encode = encoder ? function (value) { - return encoder.call(this, value, encode$1); - } : encode$1; + const _encode = encoder ? value => encoder.call(this, value, encode$1) : encode$1; return this._pairs.map(function each(pair) { return _encode(pair[0]) + '=' + _encode(pair[1]); }, '').join('&'); @@ -39050,11 +39445,16 @@ function buildURL(url, params, options) { if (!params) { return url; } - const _encode = options && options.encode || encode; + url = url || ''; const _options = utils$1.isFunction(options) ? { serialize: options } : options; - const serializeFn = _options && _options.serialize; + + // Read serializer options pollution-safely: own properties and methods on a + // class/template prototype are honored, but values injected onto a polluted + // Object.prototype are ignored. + const _encode = utils$1.getSafeProp(_options, 'encode') || encode; + const serializeFn = utils$1.getSafeProp(_options, 'serialize'); let serializedParams; if (serializeFn) { serializedParams = serializeFn(params, _options); @@ -39142,7 +39542,9 @@ var transitionalDefaults = { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false, - legacyInterceptorReqResOrdering: true + legacyInterceptorReqResOrdering: true, + advertiseZstdAcceptEncoding: false, + validateStatusUndefinedResolves: true }; var URLSearchParams = url.URLSearchParams; @@ -39243,6 +39645,13 @@ function toURLEncodedForm(data, options) { }); } +const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH; +function throwIfDepthExceeded(index) { + if (index > MAX_DEPTH) { + throw new AxiosError('FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); + } +} + /** * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] * @@ -39251,13 +39660,24 @@ function toURLEncodedForm(data, options) { * @returns An array of strings. */ function parsePropPath(name) { - // foo[x][y][z] - // foo.x.y.z - // foo-x-y-z - // foo x y z - return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => { - return match[0] === '[]' ? '' : match[1] || match[0]; - }); + // foo[x][y][z] -> ['foo', 'x', 'y', 'z'] + // foo.x.y.z -> ['foo', 'x', 'y', 'z'] + // A path is split on `.` and on `[...]` groups. A segment — whether written + // in dot notation or captured inside brackets — may contain any character + // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept + // literal instead of being split (#5402). `.`, `[` and `]` keep their existing + // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push. + // Excluding `[` from the bracket group also makes the match fail fast at the + // next `[`, so a malformed name cannot rescan to the end of the string from + // every unmatched `[` — parsing stays linear in the length of the name. + const path = []; + const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; + let match; + while ((match = pattern.exec(name)) !== null) { + throwIfDepthExceeded(path.length); + path.push(match[0] === '[]' ? '' : match[1] || match[0]); + } + return path; } /** @@ -39289,6 +39709,7 @@ function arrayToObject(arr) { */ function formDataToJSON(formData) { function buildPath(path, value, target, index) { + throwIfDepthExceeded(index); let name = path[index++]; if (name === '__proto__') return true; const isNumericKey = Number.isFinite(+name); @@ -39526,7 +39947,62 @@ function isAbsoluteURL(url) { * @returns {string} The combined URL */ function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; + if (!relativeURL) { + return baseURL; + } + let end = baseURL.length; + while (end > 0 && baseURL.charCodeAt(end - 1) === 47) { + end--; + } + return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, ''); +} + +const malformedHttpProtocol = /^https?:(?!\/\/)/i; +const httpProtocolControlCharacters = /[\t\n\r]/g; +function stripLeadingC0ControlOrSpace(url) { + let i = 0; + while (i < url.length && url.charCodeAt(i) <= 0x20) { + i++; + } + return url.slice(i); +} +function normalizeURLForProtocolCheck(url) { + return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, ''); +} + +// Redact the parts of a URL that can carry secrets before it is embedded in an +// error message. AxiosError.toJSON() serializes `message` verbatim and errors +// are commonly logged, while the opt-in `config.redact` model only cleans +// config keys — it cannot reach the message. Redact only the genuinely +// sensitive substrings — userinfo (credentials), query parameter values and +// fragment contents — with the same REDACTED marker the config redaction uses, +// while keeping the scheme, host, path and parameter names so the offending +// request stays accurately identifiable. +function redactFragment(fragment) { + if (!fragment) { + return fragment; + } + return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => { + return `${separator}${parameterName}${REDACTED}`; + }); +} +function redactSensitiveURLParts(url) { + const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`); + const fragmentIndex = redactedURL.indexOf('#'); + const urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex); + const redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, `$1${REDACTED}`); + if (fragmentIndex === -1) { + return redactedURLWithoutFragment; + } + return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`; +} +function assertValidHttpProtocolURL(url, config) { + if (typeof url === 'string') { + const normalizedURL = normalizeURLForProtocolCheck(url); + if (malformedHttpProtocol.test(normalizedURL)) { + throw new AxiosError(`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, AxiosError.ERR_INVALID_URL, config); + } + } } /** @@ -39539,9 +40015,11 @@ function combineURLs(baseURL, relativeURL) { * * @returns {string} The combined full path */ -function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { +function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { + assertValidHttpProtocolURL(requestedURL, config); let isRelativeUrl = !isAbsoluteURL(requestedURL); if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) { + assertValidHttpProtocolURL(baseURL, config); return combineURLs(baseURL, requestedURL); } return requestedURL; @@ -39643,7 +40121,7 @@ function getEnv(key) { return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ''; } -const VERSION = "1.16.1"; +const VERSION = "1.19.0"; function parseProtocol(url) { const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url); @@ -39683,13 +40161,13 @@ function fromDataURI(uri, asBlob, options) { // RFC 2397 section 3: default mediatype is text/plain;charset=US-ASCII // Bare `data:,` leaves mime undefined; Blob normalises that to "" per spec. - let mime; + let mime = ''; if (type) { mime = params ? type + params : type; } else if (params) { mime = 'text/plain' + params; } - const buffer = Buffer.from(decodeURIComponent(body), encoding); + const buffer = encoding === 'base64' ? Buffer.from(body, 'base64') : Buffer.from(decodeURIComponent(body), encoding); if (asBlob) { if (!_Blob) { throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT); @@ -39703,6 +40181,31 @@ function fromDataURI(uri, asBlob, options) { throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT); } +const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length']; + +/** + * Apply the headers generated by a FormData implementation to the request headers, + * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the + * content-* headers; otherwise merge all of them. + * + * @param {AxiosHeaders} headers - the request headers to mutate + * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation + * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value + * + * @returns {void} + */ +function setFormDataHeaders(headers, formHeaders, policy) { + if (policy !== 'content-only') { + headers.set(formHeaders); + return; + } + Object.entries(formHeaders || {}).forEach(([key, val]) => { + if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); +} + const kInternals = Symbol('internals'); class AxiosTransformStream extends stream.Transform { constructor(options) { @@ -39882,10 +40385,10 @@ const formDataToStream = (form, headersHandler, options) => { boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET) } = options || {}; if (!utils$1.isFormData(form)) { - throw TypeError('FormData instance required'); + throw new TypeError('FormData instance required'); } if (boundary.length < 1 || boundary.length > 70) { - throw Error('boundary must be 1-70 characters long'); + throw new Error('boundary must be 1-70 characters long'); } const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF); @@ -39935,6 +40438,84 @@ class ZlibHeaderTransformStream extends stream.Transform { } } +class Http2Sessions { + constructor() { + this.sessions = Object.create(null); + } + getSession(authority, options) { + options = Object.assign({ + sessionTimeout: 1000 + }, options); + let authoritySessions = this.sessions[authority]; + if (authoritySessions) { + let len = authoritySessions.length; + for (let i = 0; i < len; i++) { + const [sessionHandle, sessionOptions] = authoritySessions[i]; + if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) { + return sessionHandle; + } + } + } + const session = http2.connect(authority, options); + let removed; + let timer; + const removeSession = () => { + if (removed) { + return; + } + removed = true; + if (timer) { + clearTimeout(timer); + timer = null; + } + let entries = authoritySessions, + len = entries.length, + i = len; + while (i--) { + if (entries[i][0] === session) { + if (len === 1) { + delete this.sessions[authority]; + } else { + entries.splice(i, 1); + } + if (!session.closed) { + session.close(); + } + return; + } + } + }; + const originalRequestFn = session.request; + const { + sessionTimeout + } = options; + if (sessionTimeout != null) { + let streamsCount = 0; + session.request = function () { + const stream = originalRequestFn.apply(this, arguments); + streamsCount++; + if (timer) { + clearTimeout(timer); + timer = null; + } + stream.once('close', () => { + if (! --streamsCount) { + timer = setTimeout(() => { + timer = null; + removeSession(); + }, sessionTimeout); + } + }); + return stream; + }; + } + session.once('close', removeSession); + let entry = [session, options]; + authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; + return session; + } +} + const callbackify = (fn, reducer) => { return utils$1.isAsyncFn(fn) ? function (...args) { const cb = args.pop(); @@ -39948,13 +40529,132 @@ const callbackify = (fn, reducer) => { } : fn; }; -const LOOPBACK_HOSTNAMES = new Set(['localhost']); +const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']); const isIPv4Loopback = host => { const parts = host.split('.'); if (parts.length !== 4) return false; if (parts[0] !== '127') return false; return parts.every(p => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255); }; + +/** + * Canonicalize an IPv4 address written in shorthand, octal, or hex form into + * dotted-decimal. IPv6 addresses and non-IP strings are returned unchanged so + * the existing IPv4-mapped IPv6 unmap path and the isLoopback path can still + * see them. + * + * Shorthand expansion mirrors Node's URL parser: literal parts fill from the + * left, the final part fills the remaining octets from the right with + * zero-padding on the left. + * 127.1 -> 127.0.0.1 + * 127.0.1 -> 127.0.0.1 + * 1.2.3 -> 1.2.0.3 + * + * Each octet is parsed with an explicit base: 16 for `0x`/`0X` prefix, 8 for + * zero-prefixed multi-digit all-`0-7` parts, 10 otherwise. Zero-prefixed + * decimal-looking parts that contain `8` or `9` are rejected to match Node's + * URL parser, and the comparison layer falls through to non-bypass if either + * side rejects the form (fail-safe). + * + * Returns the input unchanged on any parse failure, out-of-range octet, or + * unusual shape (1-part, 5+ parts) so the comparison layer fails closed. + */ +const parseIPv4Octet = text => { + if (/^0[xX][0-9a-fA-F]+$/.test(text)) { + const n = parseInt(text.slice(2), 16); + return Number.isFinite(n) ? n : null; + } + if (text.length > 1 && /^0[0-7]+$/.test(text)) { + const n = parseInt(text, 8); + return Number.isFinite(n) ? n : null; + } + if (text.length > 1 && /^0[0-9]+$/.test(text)) { + return null; + } + if (/^[0-9]+$/.test(text)) { + const n = parseInt(text, 10); + return Number.isFinite(n) ? n : null; + } + return null; +}; +const normalizeIPAddress = host => { + if (typeof host !== 'string' || !host || host.indexOf(':') !== -1) { + return host; + } + let h = host; + if (h.charAt(0) === '[' && h.charAt(h.length - 1) === ']') { + h = h.slice(1, -1); + } + h = h.replace(/\.+$/, ''); + + // Allowed characters for any IPv4 shape: digits, dot, 'x', 'X', hex digits. + if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host; + const parts = h.split('.'); + + // No part may be empty (e.g. "127..0.1" or "127.0.0."). Trailing dots are + // already stripped above; this guards against the empty-middle case. + if (parts.some(p => p === '')) return host; + if (parts.length === 4) { + // Full IPv4 form: each part is an octet. + const octets = parts.map(parseIPv4Octet); + if (octets.some(n => n === null || n < 0 || n > 255)) return host; + return octets.join('.'); + } + if (parts.length > 4) { + return host; + } + + // Shorthand: 1..3 parts. Node's URL parser treats a 1-part input as a 32-bit + // integer split into octets, which has surprising semantics (e.g. "127" -> + // "0.0.0.127"). Reject 1-part inputs to keep the helper predictable: the + // fail-safe returns the input unchanged and the comparison layer falls + // through to non-bypass. + if (parts.length === 1) return host; + + // 2..3 parts: literal parts fill from the left, tail fills remaining octets + // from the right with zero-padding. + const literalOctets = parts.slice(0, -1); + const tail = parts[parts.length - 1]; + const tailSlots = 4 - literalOctets.length; + + // Tail is parsed as a full IPv4 number (hex/octal/decimal) and packed + // low-byte-right into the remaining octets, matching Node's URL parser. + // e.g. 127.65535 (tail 0xFFFF into 3 slots) -> 127.0.255.255; + // 127.0x00ff (tail 0xFF into 3 slots) -> 127.0.0.255; + // 127.0.65535 (tail 0xFFFF into 2 slots) -> 127.0.255.255. + const tailValue = parseIPv4Octet(tail); + if (tailValue === null) return host; + const maxTail = (1 << 8 * tailSlots) - 1; + if (tailValue < 0 || tailValue > maxTail) return host; + const tailOctets = new Array(tailSlots).fill(0); + for (let i = tailSlots - 1, v = tailValue; i >= 0; i--, v >>= 8) { + tailOctets[i] = v & 0xff; + } + const literal = literalOctets.map(parseIPv4Octet); + if (literal.some(n => n === null || n < 0 || n > 255)) return host; + return [...literal, ...tailOctets].join('.'); +}; +const isIPv6ZeroGroup = group => /^0{1,4}$/.test(group); + +// The unspecified address (IPv4 0.0.0.0 / IPv6 ::) resolves to the local host +// for outbound connections, so treat it as loopback-equivalent for NO_PROXY +// matching. 0.0.0.0 is covered by LOOPBACK_HOSTNAMES; this handles compressed +// and full IPv6 all-zero forms so both families bypass symmetrically. +const isIPv6Unspecified = host => { + if (host === '::') return true; + const compressionIndex = host.indexOf('::'); + if (compressionIndex !== -1) { + if (compressionIndex !== host.lastIndexOf('::')) return false; + const left = host.slice(0, compressionIndex); + const right = host.slice(compressionIndex + 2); + const leftGroups = left ? left.split(':') : []; + const rightGroups = right ? right.split(':') : []; + const explicitGroups = leftGroups.length + rightGroups.length; + return explicitGroups < 8 && leftGroups.every(isIPv6ZeroGroup) && rightGroups.every(isIPv6ZeroGroup); + } + const groups = host.split(':'); + return groups.length === 8 && groups.every(isIPv6ZeroGroup); +}; const isIPv6Loopback = host => { // Collapse all-zero groups: any form of ::1 / 0:0:...:0:1 // First, strip any leading "::" by normalising with Set lookup of common forms, @@ -39987,6 +40687,7 @@ const isLoopback = host => { if (!host) return false; if (LOOPBACK_HOSTNAMES.has(host)) return true; if (isIPv4Loopback(host)) return true; + if (isIPv6Unspecified(host)) return true; return isIPv6Loopback(host); }; const DEFAULT_PORTS = { @@ -40046,7 +40747,15 @@ const normalizeNoProxyHost = hostname => { if (hostname.charAt(0) === '[' && hostname.charAt(hostname.length - 1) === ']') { hostname = hostname.slice(1, -1); } - return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, '')); + const trimmed = hostname.replace(/\.+$/, ''); + + // IPv4 shorthand/octal/hex → dotted-decimal; helper is a no-op for inputs + // containing ':' (IPv6 and IPv4-mapped IPv6) so we fall through to unmap. + const ipv4 = normalizeIPAddress(trimmed); + if (ipv4 !== trimmed) { + return ipv4; + } + return unmapIPv4MappedIPv6(trimmed); }; function shouldBypassProxy(location) { let parsed; @@ -40068,6 +40777,9 @@ function shouldBypassProxy(location) { if (!entry) { return false; } + if (entry === '*') { + return true; + } let [entryHost, entryPort] = parseNoProxyEntry(entry); entryHost = normalizeNoProxyHost(entryHost); if (!entryHost) { @@ -40174,7 +40886,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => { } const rawLoaded = e.loaded; const total = e.lengthComputable ? e.total : undefined; - const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded; + const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded); const progressBytes = Math.max(0, loaded - bytesNotified); const rate = _speedometer(progressBytes); bytesNotified = Math.max(bytesNotified, loaded); @@ -40200,18 +40912,85 @@ const progressEventDecorator = (total, throttled) => { loaded }), throttled[1]]; }; -const asyncDecorator = fn => (...args) => utils$1.asap(() => fn(...args)); +const asyncDecorator = (fn, scheduler = utils$1.asap) => (...args) => scheduler(() => fn(...args)); + +/** + * Estimate data: URL byte lengths *without* allocating large buffers. + * - Fetch percent-decodes a base64 body before decoding it. + * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the + * raw body, including ignored characters and content after padding. + * - Non-base64 data is percent-decoded and then encoded as UTF-8. + */ +const isHexDigit = charCode => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102; +const isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2)); +const hexValue = charCode => charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55; +const isBase64Char = charCode => charCode >= 65 && charCode <= 90 || +// A-Z +charCode >= 97 && charCode <= 122 || +// a-z +charCode >= 48 && charCode <= 57 || +// 0-9 +charCode === 43 || +// + +charCode === 47 || +// / +charCode === 45 || +// - (base64url) +charCode === 95; // _ (base64url) + +const isBase64Whitespace = charCode => charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32; +const base64Bytes = significant => { + const groups = Math.floor(significant / 4); + const remainder = significant % 4; + return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0); +}; -/** - * Estimate decoded byte length of a data:// URL *without* allocating large buffers. - * - For base64: compute exact decoded size using length and padding; - * handle %XX at the character-count level (no string allocation). - * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound. - * - * @param {string} url - * @returns {number} - */ -function estimateDataURLDecodedBytes(url) { +// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation +// upper bound even when Buffer.from later ignores characters or stops at '='. +const estimateBase64BufferAllocation = body => { + const len = body.length; + let padding = 0; + if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) { + padding++; + if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) { + padding++; + } + } + return Math.floor((len - padding) * 3 / 4); +}; +const estimatePercentDecodedBase64Bytes = body => { + const len = body.length; + let significant = 0; + let padding = 0; + let invalid = false; + for (let i = 0; i < len; i++) { + let code = body.charCodeAt(i); + if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { + code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2)); + i += 2; + } + if (isBase64Whitespace(code)) { + continue; + } + if (code === 61 /* '=' */) { + padding++; + continue; + } + if (!isBase64Char(code) || padding > 0) { + invalid = true; + continue; + } + significant++; + } + + // Fetch rejects malformed forgiving-base64 input. Returning the raw-size + // allocation bound keeps that invalid input from becoming a pre-check bypass. + if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) { + return estimateBase64BufferAllocation(body); + } + return base64Bytes(significant); +}; +const estimateDataURLBytes = (url, estimateBase64) => { if (!url || typeof url !== 'string') return 0; if (!url.startsWith('data:')) return 0; const comma = url.indexOf(','); @@ -40220,60 +40999,20 @@ function estimateDataURLDecodedBytes(url) { const body = url.slice(comma + 1); const isBase64 = /;base64/i.test(meta); if (isBase64) { - let effectiveLen = body.length; - const len = body.length; // cache length - - for (let i = 0; i < len; i++) { - if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) { - const a = body.charCodeAt(i + 1); - const b = body.charCodeAt(i + 2); - const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102); - if (isHex) { - effectiveLen -= 2; - i += 2; - } - } - } - let pad = 0; - let idx = len - 1; - const tailIsPct3D = j => j >= 2 && body.charCodeAt(j - 2) === 37 && - // '%' - body.charCodeAt(j - 1) === 51 && ( - // '3' - body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd' - - if (idx >= 0) { - if (body.charCodeAt(idx) === 61 /* '=' */) { - pad++; - idx--; - } else if (tailIsPct3D(idx)) { - pad++; - idx -= 3; - } - } - if (pad === 1 && idx >= 0) { - if (body.charCodeAt(idx) === 61 /* '=' */) { - pad++; - } else if (tailIsPct3D(idx)) { - pad++; - } - } - const groups = Math.floor(effectiveLen / 4); - const bytes = groups * 3 - (pad || 0); - return bytes > 0 ? bytes : 0; - } - if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') { - return Buffer.byteLength(body, 'utf8'); + return estimateBase64(body); } // Compute UTF-8 byte length directly from UTF-16 code units without allocating // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies). - // Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit - // but 3 UTF-8 bytes). + // Valid %XX triplets count as one decoded byte; this matches the bytes that + // decodeURIComponent(body) would produce before Buffer re-encodes the string. let bytes = 0; for (let i = 0, len = body.length; i < len; i++) { const c = body.charCodeAt(i); - if (c < 0x80) { + if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) { + bytes += 1; + i += 2; + } else if (c < 0x80) { bytes += 1; } else if (c < 0x800) { bytes += 2; @@ -40290,6 +41029,28 @@ function estimateDataURLDecodedBytes(url) { } } return bytes; +}; + +/** + * Estimate the percent-decoded payload size used by Fetch data: URLs. + * + * @param {string} url + * @returns {number} + */ +function estimateDataURLDecodedBytes(url) { + // Fetch removes URL fragments before processing a data: URL. + const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1; + return estimateDataURLBytes(fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes); +} + +/** + * Estimate the Buffer backing allocation used by Node's raw base64 decoder. + * + * @param {string} url + * @returns {number} + */ +function estimateDataURLBufferAllocation(url) { + return estimateDataURLBytes(url, estimateBase64BufferAllocation); } const zlibOptions = { @@ -40300,24 +41061,20 @@ const brotliOptions = { flush: zlib.constants.BROTLI_OPERATION_FLUSH, finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH }; +const zstdOptions = { + flush: zlib.constants.ZSTD_e_flush, + finishFlush: zlib.constants.ZSTD_e_flush +}; const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress); +const isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress); +const ACCEPT_ENCODING = 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''); +const ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ', zstd' : ''); +const scheduleProgress = typeof process !== 'undefined' && process.nextTick ? process.nextTick.bind(process) : utils$1.asap; const { http: httpFollow, https: httpsFollow } = followRedirects; const isHttps = /https:?/; -const FORM_DATA_CONTENT_HEADERS$1 = ['content-type', 'content-length']; -function setFormDataHeaders$1(headers, formHeaders, policy) { - if (policy !== 'content-only') { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); -} // Symbols used to bind a single 'error' listener to a pooled socket and track // the request currently owning that socket across keep-alive reuse (issue #10780). @@ -40335,6 +41092,36 @@ const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel'); // so unbounded growth is not a concern in practice. const tunnelingAgentCache = new Map(); const tunnelingAgentCacheUser = new WeakMap(); +// Minimum minor versions where Node's HTTP Agent supports native proxyEnv +// handling. Checking the selected agent below also covers startup modes such +// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence. +const NODE_NATIVE_ENV_PROXY_SUPPORT = { + 22: 21, + 24: 5 +}; +function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) { + if (!nodeVersion) { + return false; + } + const [major, minor] = nodeVersion.split('.').map(part => Number(part)); + if (!Number.isInteger(major) || !Number.isInteger(minor)) { + return false; + } + if (major > 24) { + return true; + } + return NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major]; +} +function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) { + if (!isNodeNativeEnvProxySupported(nodeVersion)) { + return false; + } + const agentOptions = agent && agent.options; + return Boolean(agentOptions && utils$1.hasOwnProp(agentOptions, 'proxyEnv') && agentOptions.proxyEnv != null); +} +function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) { + return isHttps.test(options.protocol) ? configHttpsAgent || https.globalAgent : configHttpAgent || http.globalAgent; +} function getTunnelingAgent(agentOptions, userHttpsAgent) { const key = agentOptions.protocol + '//' + agentOptions.hostname + ':' + (agentOptions.port || '') + '#' + (agentOptions.auth || ''); const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, new Map()).get(userHttpsAgent) : tunnelingAgentCache; @@ -40348,6 +41135,19 @@ function getTunnelingAgent(agentOptions, userHttpsAgent) { ...agentOptions } : agentOptions; agent = new HttpsProxyAgent(merged); + if (userHttpsAgent && userHttpsAgent.options) { + const originTLSOptions = { + ...userHttpsAgent.options + }; + const callback = agent.callback; + agent.callback = function axiosTunnelingAgentCallback(req, opts) { + // HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade. + return callback.call(this, req, { + ...originTLSOptions, + ...opts + }); + }; + } agent[kAxiosInstalledTunnel] = true; cache.set(key, agent); return agent; @@ -40360,7 +41160,7 @@ const supportedProtocols = platform.protocols.map(protocol => { // Decode before composing the `auth` option so credentials such as // `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the // original value for malformed input so a bad encoding never throws. -const decodeURIComponentSafe = value => { +const decodeURIComponentSafe$1 = value => { if (!utils$1.isString(value)) { return value; } @@ -40374,84 +41174,11 @@ const flushOnFinish = (stream, [throttled, flush]) => { stream.on('end', flush).on('error', flush); return throttled; }; -class Http2Sessions { - constructor() { - this.sessions = Object.create(null); - } - getSession(authority, options) { - options = Object.assign({ - sessionTimeout: 1000 - }, options); - let authoritySessions = this.sessions[authority]; - if (authoritySessions) { - let len = authoritySessions.length; - for (let i = 0; i < len; i++) { - const [sessionHandle, sessionOptions] = authoritySessions[i]; - if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) { - return sessionHandle; - } - } - } - const session = http2.connect(authority, options); - let removed; - const removeSession = () => { - if (removed) { - return; - } - removed = true; - let entries = authoritySessions, - len = entries.length, - i = len; - while (i--) { - if (entries[i][0] === session) { - if (len === 1) { - delete this.sessions[authority]; - } else { - entries.splice(i, 1); - } - if (!session.closed) { - session.close(); - } - return; - } - } - }; - const originalRequestFn = session.request; - const { - sessionTimeout - } = options; - if (sessionTimeout != null) { - let timer; - let streamsCount = 0; - session.request = function () { - const stream = originalRequestFn.apply(this, arguments); - streamsCount++; - if (timer) { - clearTimeout(timer); - timer = null; - } - stream.once('close', () => { - if (! --streamsCount) { - timer = setTimeout(() => { - timer = null; - removeSession(); - }, sessionTimeout); - } - }); - return stream; - }; - } - session.once('close', removeSession); - let entry = [session, options]; - authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; - return session; - } -} const http2Sessions = new Http2Sessions(); /** - * If the proxy or config beforeRedirects functions are defined, call them with the options - * object. + * If the proxy, auth, sensitive header, or config beforeRedirects functions are defined, + * call them with the options object. * * @param {Object} options - The options object that was passed to the request. * @@ -40461,10 +41188,37 @@ function dispatchBeforeRedirect(options, responseDetails, requestDetails) { if (options.beforeRedirects.proxy) { options.beforeRedirects.proxy(options); } + if (options.beforeRedirects.auth) { + options.beforeRedirects.auth(options); + } + if (options.beforeRedirects.sensitiveHeaders) { + options.beforeRedirects.sensitiveHeaders(options, requestDetails); + } if (options.beforeRedirects.config) { options.beforeRedirects.config(options, responseDetails, requestDetails); } } +function stripMatchingHeaders(headers, sensitiveSet) { + if (!headers) { + return; + } + Object.keys(headers).forEach(header => { + if (sensitiveSet.has(header.toLowerCase())) { + delete headers[header]; + } + }); +} +function isSameOriginRedirect(redirectOptions, requestDetails) { + if (!requestDetails) { + return false; + } + try { + return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin; + } catch (e) { + // If origin comparison fails, treat the redirect as unsafe. + return false; + } +} /** * If the proxy or config afterRedirects functions are defined, call them with the options @@ -40475,9 +41229,10 @@ function dispatchBeforeRedirect(options, responseDetails, requestDetails) { * * @returns {http.ClientRequestArgs} */ -function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) { +function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) { let proxy = configProxy; - if (!proxy && proxy !== false) { + const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent); + if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) { const proxyUrl = getProxyForUrl(location); if (proxyUrl) { if (!shouldBypassProxy(location)) { @@ -40568,7 +41323,7 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) } const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent); // Set both: `options.agent` is consumed by the native https.request path - // (config.maxRedirects === 0); `options.agents.https` is consumed by + // (maxRedirects === 0); `options.agents.https` is consumed by // follow-redirects, which ignores `options.agent` when `options.agents` // is present. options.agent = tunnelingAgent; @@ -40612,7 +41367,7 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { // Configure proxy for redirected request, passing the original config proxy to apply // the exact same logic as if the redirected request was performed by axios directly. - setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent); + setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent); }; } const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process'; @@ -40695,16 +41450,30 @@ const http2Transport = { /*eslint consistent-return:0*/ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { - const own = key => utils$1.hasOwnProp(config, key) ? config[key] : undefined; + // Read config pollution-safely: own properties and members inherited from + // a non-Object.prototype source (e.g. an Object.create(defaults) template) + // are honored, but values injected onto a polluted Object.prototype are + // ignored. All behavior-affecting reads in this adapter go through own() + // so the protection boundary stays consistent. + const own = key => utils$1.getSafeProp(config, key); + const transitional = own('transitional') || transitionalDefaults; let data = own('data'); let lookup = own('lookup'); let family = own('family'); let httpVersion = own('httpVersion'); if (httpVersion === undefined) httpVersion = 1; let http2Options = own('http2Options'); + const httpAgent = own('httpAgent'); + const httpsAgent = own('httpsAgent'); + const configProxy = own('proxy'); const responseType = own('responseType'); const responseEncoding = own('responseEncoding'); - const method = config.method.toUpperCase(); + const socketPath = own('socketPath'); + const method = own('method').toUpperCase(); + const maxRedirects = own('maxRedirects'); + const maxBodyLength = own('maxBodyLength'); + const maxContentLength = own('maxContentLength'); + const decompress = own('decompress'); let isDone; let rejected = false; let req; @@ -40735,7 +41504,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { try { abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason); } catch (err) { - console.warn('emit error', err); + // ignore emit errors } } function clearConnectPhaseTimer() { @@ -40745,10 +41514,11 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { } } function createTimeoutError() { - let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; - const transitional = config.transitional || transitionalDefaults; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; + const configTimeout = own('timeout'); + let timeoutErrorMessage = configTimeout ? 'timeout of ' + configTimeout + 'ms exceeded' : 'timeout exceeded'; + const configTimeoutErrorMessage = own('timeoutErrorMessage'); + if (configTimeoutErrorMessage) { + timeoutErrorMessage = configTimeoutErrorMessage; } return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req); } @@ -40791,17 +41561,22 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { }); // Parse url - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); - const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined); + const fullPath = buildFullPath(own('baseURL'), own('url'), own('allowAbsoluteUrls'), config); + // Unix-socket requests (own socketPath) commonly pass a path-only url + // like '/foo'; supply a synthetic base so new URL() can still parse it. + // Use the own-property value (not config.socketPath) so a polluted + // prototype cannot influence URL base selection. + const urlBase = socketPath ? 'http://localhost' : platform.hasBrowserEnv ? platform.origin : undefined; + const parsed = new URL(fullPath, urlBase); const protocol = parsed.protocol || supportedProtocols[0]; if (protocol === 'data:') { // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set. - if (config.maxContentLength > -1) { - // Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed. - const dataUrl = String(config.url || fullPath || ''); - const estimated = estimateDataURLDecodedBytes(dataUrl); - if (estimated > config.maxContentLength) { - return reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config)); + if (maxContentLength > -1) { + // Use the exact string passed to fromDataURI (the configured url); fall back to fullPath if needed. + const dataUrl = String(own('url') || fullPath || ''); + const estimated = estimateDataURLBufferAllocation(dataUrl); + if (estimated > maxContentLength) { + return reject(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config)); } } let convertedData; @@ -40814,7 +41589,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { }); } try { - convertedData = fromDataURI(config.url, responseType === 'blob', { + convertedData = fromDataURI(own('url'), responseType === 'blob', { Blob: config.env && config.env.Blob }); } catch (err) { @@ -40865,7 +41640,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { }); // support for https://www.npmjs.com/package/form-data api } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) { - setFormDataHeaders$1(headers, data.getHeaders(), own('formDataHeaderPolicy')); + setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); if (!headers.hasContentLength()) { try { const knownLength = await util.promisify(data.getLength).call(data); @@ -40888,7 +41663,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { // Add Content-Length header if data exists headers.setContentLength(data.length, false); - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + if (maxBodyLength > -1 && data.length > maxBodyLength) { return reject(new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config)); } } @@ -40908,34 +41683,33 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { data = stream.pipeline([data, new AxiosTransformStream({ maxRate: utils$1.toFiniteNumber(maxUploadRate) })], utils$1.noop); - onUploadProgress && data.on('progress', flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3)))); + onUploadProgress && data.on('progress', flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3)))); } // HTTP basic authentication let auth = undefined; const configAuth = own('auth'); if (configAuth) { - const username = configAuth.username || ''; - const password = configAuth.password || ''; + const username = utils$1.getSafeProp(configAuth, 'username') || ''; + const password = utils$1.getSafeProp(configAuth, 'password') || ''; auth = username + ':' + password; } - if (!auth && parsed.username) { - const urlUsername = decodeURIComponentSafe(parsed.username); - const urlPassword = decodeURIComponentSafe(parsed.password); + if (!auth && (parsed.username || parsed.password)) { + const urlUsername = decodeURIComponentSafe$1(parsed.username); + const urlPassword = decodeURIComponentSafe$1(parsed.password); auth = urlUsername + ':' + urlPassword; } auth && headers.delete('authorization'); let path$1; try { - path$1 = buildURL(parsed.pathname + parsed.search, config.params, config.paramsSerializer).replace(/^\?/, ''); + path$1 = buildURL(parsed.pathname + parsed.search, own('params'), own('paramsSerializer')).replace(/^\?/, ''); } catch (err) { - const customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - return reject(customErr); + return reject(AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, { + url: own('url'), + exists: true + })); } - headers.set('Accept-Encoding', 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false); + headers.set('Accept-Encoding', utils$1.hasOwnProp(transitional, 'advertiseZstdAcceptEncoding') && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false); // Null-prototype to block prototype pollution gadgets on properties read // directly by Node's http.request (e.g. insecureHTTPParser, lookup). @@ -40944,8 +41718,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { method: method, headers: toByteStringHeaderObject(headers), agents: { - http: config.httpAgent, - https: config.httpsAgent + http: httpAgent, + https: httpsAgent }, auth, protocol, @@ -40957,31 +41731,37 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { // cacheable-lookup integration hotfix !utils$1.isUndefined(lookup) && (options.lookup = lookup); - if (config.socketPath) { - if (typeof config.socketPath !== 'string') { + if (socketPath) { + if (typeof socketPath !== 'string') { return reject(new AxiosError('socketPath must be a string', AxiosError.ERR_BAD_OPTION_VALUE, config)); } - if (config.allowedSocketPaths != null) { - const allowed = Array.isArray(config.allowedSocketPaths) ? config.allowedSocketPaths : [config.allowedSocketPaths]; - const resolvedSocket = path.resolve(config.socketPath); + const allowedSocketPaths = own('allowedSocketPaths'); + if (allowedSocketPaths != null) { + const allowed = Array.isArray(allowedSocketPaths) ? allowedSocketPaths : [allowedSocketPaths]; + const resolvedSocket = path.resolve(socketPath); const isAllowed = allowed.some(entry => typeof entry === 'string' && path.resolve(entry) === resolvedSocket); if (!isAllowed) { - return reject(new AxiosError(`socketPath "${config.socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config)); + return reject(new AxiosError(`socketPath "${socketPath}" is not permitted by allowedSocketPaths`, AxiosError.ERR_BAD_OPTION_VALUE, config)); } } - options.socketPath = config.socketPath; + options.socketPath = socketPath; } else { options.hostname = parsed.hostname.startsWith('[') ? parsed.hostname.slice(1, -1) : parsed.hostname; options.port = parsed.port; - setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, false, config.httpsAgent); + setProxy(options, configProxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path, false, httpsAgent, httpAgent); } let transport; let isNativeTransport = false; + // True only for the follow-redirects transport, which applies + // options.maxBodyLength itself. Every other transport (http2, native + // http/https, a user-supplied custom transport) needs the explicit + // byte-counting pipeline below to enforce maxBodyLength on streamed uploads. + let transportEnforcesMaxBodyLength = false; const isHttpsRequest = isHttps.test(options.protocol); // Don't clobber a CONNECT-tunneling agent installed by setProxy() for an // HTTPS target. if (options.agent == null) { - options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + options.agent = isHttpsRequest ? httpsAgent : httpAgent; } if (isHttp2) { transport = http2Transport; @@ -40989,24 +41769,67 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { const configTransport = own('transport'); if (configTransport) { transport = configTransport; - } else if (config.maxRedirects === 0) { + } else if (maxRedirects === 0) { transport = isHttpsRequest ? https : http; isNativeTransport = true; } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; + transportEnforcesMaxBodyLength = true; + options.sensitiveHeaders = []; + if (maxRedirects) { + options.maxRedirects = maxRedirects; } const configBeforeRedirect = own('beforeRedirect'); if (configBeforeRedirect) { options.beforeRedirects.config = configBeforeRedirect; } + if (auth) { + // Restore HTTP Basic credentials on same-origin redirects only. + // follow-redirects >= 1.15.8 strips Authorization on every redirect (see #6929); + // cross-origin stripping is the documented mitigation for T-R2 in THREATMODEL.md + // and is preserved by deliberately not restoring on origin change. + const requestOrigin = parsed.origin; + const authToRestore = auth; + options.beforeRedirects.auth = function beforeRedirectAuth(redirectOptions) { + try { + if (new URL(redirectOptions.href).origin === requestOrigin) { + redirectOptions.auth = authToRestore; + } + } catch (e) { + // ignore malformed URL: leaving auth stripped is fail-safe + } + }; + } + const sensitiveHeaders = own('sensitiveHeaders'); + if (sensitiveHeaders != null) { + if (!utils$1.isArray(sensitiveHeaders)) { + return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config)); + } + const sensitiveSet = new Set(); + for (const header of sensitiveHeaders) { + if (!utils$1.isString(header)) { + return reject(new AxiosError('sensitiveHeaders must be an array of strings', AxiosError.ERR_BAD_OPTION_VALUE, config)); + } + sensitiveSet.add(header.toLowerCase()); + } + if (sensitiveSet.size) { + options.sensitiveHeaders = Array.from(sensitiveSet); + options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(redirectOptions, requestDetails) { + if (!isSameOriginRedirect(redirectOptions, requestDetails)) { + stripMatchingHeaders(redirectOptions.headers, sensitiveSet); + } + }; + } + } transport = isHttpsRequest ? httpsFollow : httpFollow; } } - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; + + // Set an explicit maxBodyLength option for transports that inspect it. + // When maxBodyLength is -1 (default/unlimited), use Infinity so + // follow-redirects does not fall back to its own 10MB default. + if (maxBodyLength > -1) { + options.maxBodyLength = maxBodyLength; } else { - // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited options.maxBodyLength = Infinity; } @@ -41025,7 +41848,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { const transformStream = new AxiosTransformStream({ maxRate: utils$1.toFiniteNumber(maxDownloadRate) }); - onDownloadProgress && transformStream.on('progress', flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)))); + onDownloadProgress && transformStream.on('progress', flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress, scheduleProgress), true, 3)))); streams.push(transformStream); } @@ -41036,7 +41859,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { const lastRequest = res.req || req; // if decompress disabled we should not decompress - if (config.decompress !== false && res.headers['content-encoding']) { + if (decompress !== false && res.headers['content-encoding']) { // if no content, but headers still say that it is encoded, // remove the header not confuse downstream operations if (method === 'HEAD' || res.statusCode === 204) { @@ -41068,6 +41891,13 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { streams.push(zlib.createBrotliDecompress(brotliOptions)); delete res.headers['content-encoding']; } + break; + case 'zstd': + if (isZstdSupported) { + streams.push(zlib.createZstdDecompress(zstdOptions)); + delete res.headers['content-encoding']; + } + break; } } responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0]; @@ -41081,8 +41911,8 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { if (responseType === 'stream') { // Enforce maxContentLength on streamed responses; previously this // was applied only to buffered responses. - if (config.maxContentLength > -1) { - const limit = config.maxContentLength; + if (maxContentLength > -1) { + const limit = maxContentLength; const source = responseStream; async function* enforceMaxContentLength() { let totalResponseBytes = 0; @@ -41108,11 +41938,11 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { totalResponseBytes += chunk.length; // make sure the content length is not over the maxContentLength if specified - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + if (maxContentLength > -1 && totalResponseBytes > maxContentLength) { // stream.destroy() emit aborted event before calling reject() on Node.js v16 rejected = true; responseStream.destroy(); - abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + abort(new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); } }); responseStream.on('aborted', function handlerStreamAborted() { @@ -41175,7 +42005,11 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { const boundSockets = new Set(); req.on('socket', function handleRequestSocket(socket) { // default interval of sending ack packet is 1 minute - socket.setKeepAlive(true, 1000 * 60); + // proxy agents (e.g. agent-base) may return a generic Duplex stream + // that doesn't have setKeepAlive, so guard before calling + if (typeof socket.setKeepAlive === 'function') { + socket.setKeepAlive(true, 1000 * 60); + } // Install a single 'error' listener per socket (not per request) to avoid // accumulating listeners on pooled keep-alive sockets that get reassigned @@ -41205,9 +42039,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { }); // Handle request timeout - if (config.timeout) { + if (own('timeout')) { // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. - const timeout = parseInt(config.timeout, 10); + const timeout = parseInt(own('timeout'), 10); if (Number.isNaN(timeout)) { abort(new AxiosError('error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req)); return; @@ -41251,12 +42085,13 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { } }); - // Enforce maxBodyLength for streamed uploads on the native http/https - // transport (maxRedirects === 0); follow-redirects enforces it on the - // other path. + // Enforce maxBodyLength for streamed uploads on every transport that + // does not apply options.maxBodyLength itself (native http/https, http2, + // and user-supplied custom transports). The follow-redirects transport + // enforces it on the redirected HTTP/1 path. let uploadStream = data; - if (config.maxBodyLength > -1 && config.maxRedirects === 0) { - const limit = config.maxBodyLength; + if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) { + const limit = maxBodyLength; let bytesSent = 0; uploadStream = stream.pipeline([data, new stream.Transform({ transform(chunk, _enc, cb) { @@ -41319,7 +42154,11 @@ var cookies = platform.hasStandardBrowserEnv ? const cookie = cookies[i].replace(/^\s+/, ''); const eq = cookie.indexOf('='); if (eq !== -1 && cookie.slice(0, eq) === name) { - return decodeURIComponent(cookie.slice(eq + 1)); + try { + return decodeURIComponent(cookie.slice(eq + 1)); + } catch (e) { + return cookie.slice(eq + 1); + } } } return null; @@ -41340,6 +42179,12 @@ var cookies = platform.hasStandardBrowserEnv ? const headersToObject = thing => thing instanceof AxiosHeaders ? { ...thing } : thing; +const ownEnumerableKeys = thing => { + if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) { + return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter(symbol => Object.getOwnPropertyDescriptor(thing, symbol).enumerable)); + } + return Object.keys(thing); +}; /** * Config-specific merge-function which creates a new config-object @@ -41352,6 +42197,7 @@ const headersToObject = thing => thing instanceof AxiosHeaders ? { */ function mergeConfig(config1, config2) { // eslint-disable-next-line no-param-reassign + config1 = config1 || {}; config2 = config2 || {}; // Use a null-prototype object so that downstream reads such as `config.auth` @@ -41403,6 +42249,23 @@ function mergeConfig(config1, config2) { return getMergedValue(undefined, a); } } + function getMergedTransitionalOption(prop) { + const transitional2 = utils$1.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined; + if (!utils$1.isUndefined(transitional2)) { + if (utils$1.isPlainObject(transitional2)) { + if (utils$1.hasOwnProp(transitional2, prop)) { + return transitional2[prop]; + } + } else { + return undefined; + } + } + const transitional1 = utils$1.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined; + if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) { + return transitional1[prop]; + } + return undefined; + } // eslint-disable-next-line consistent-return function mergeDirectKeys(a, b, prop) { @@ -41444,7 +42307,7 @@ function mergeConfig(config1, config2) { validateStatus: mergeDirectKeys, headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) }; - utils$1.forEach(Object.keys({ + utils$1.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { @@ -41455,20 +42318,14 @@ function mergeConfig(config1, config2) { const configValue = merge(a, b, prop); utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); }); - return config; -} - -const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length']; -function setFormDataHeaders(headers, formHeaders, policy) { - if (policy !== 'content-only') { - headers.set(formHeaders); - return; - } - Object.entries(formHeaders).forEach(([key, val]) => { - if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { - headers.set(key, val); + if (utils$1.hasOwnProp(config2, 'validateStatus') && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption('validateStatusUndefinedResolves') === false) { + if (utils$1.hasOwnProp(config1, 'validateStatus')) { + config.validateStatus = getMergedValue(undefined, config1.validateStatus); + } else { + delete config.validateStatus; } - }); + } + return config; } /** @@ -41479,8 +42336,8 @@ function setFormDataHeaders(headers, formHeaders, policy) { * * @returns {string} UTF-8 bytes as a Latin-1 string */ -const encodeUTF8 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); -var resolveConfig = config => { +const encodeUTF8$1 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); +function resolveConfig(config) { const newConfig = mergeConfig({}, config); // Read only own properties to prevent prototype pollution gadgets @@ -41496,15 +42353,21 @@ var resolveConfig = config => { const allowAbsoluteUrls = own('allowAbsoluteUrls'); const url = own('url'); newConfig.headers = headers = AxiosHeaders.from(headers); - newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls), config.params, config.paramsSerializer); + newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), own('params'), own('paramsSerializer')); // HTTP basic authentication if (auth) { - headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))); + const username = utils$1.getSafeProp(auth, 'username') || ''; + const password = utils$1.getSafeProp(auth, 'password') || ''; + try { + headers.set('Authorization', 'Basic ' + btoa(username + ':' + (password ? encodeUTF8$1(password) : ''))); + } catch (e) { + throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config); + } } if (utils$1.isFormData(data)) { - if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { - headers.setContentType(undefined); // browser handles it + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) { + headers.setContentType(undefined); // browser/web worker/RN handles it } else if (utils$1.isFunction(data.getHeaders)) { // Node.js FormData (like form-data package) setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy')); @@ -41532,7 +42395,7 @@ var resolveConfig = config => { } } return newConfig; -}; +} const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; var xhrAdapter = isXHRAdapterSupported && function (config) { @@ -41701,6 +42564,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) { const protocol = parseProtocol(_config.url); if (protocol && !platform.protocols.includes(protocol)) { reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + done(); return; } @@ -41739,7 +42603,18 @@ const composeSignals = (signals, timeout) => { }); signals = null; }; - signals.forEach(signal => signal.addEventListener('abort', onabort)); + signals.forEach(signal => { + if (aborted) { + return; + } + if (signal.aborted) { + onabort.call(signal); + return; + } + signal.addEventListener('abort', onabort, { + once: true + }); + }); const { signal } = controller; @@ -41833,6 +42708,31 @@ const DEFAULT_CHUNK_SIZE = 64 * 1024; const { isFunction } = utils$1; + +/** + * Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). + * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. + * + * @param {string} str The string to encode + * + * @returns {string} UTF-8 bytes as a Latin-1 string + */ +const encodeUTF8 = str => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); + +// Node's WHATWG URL parser returns `username` and `password` percent-encoded. +// Decode before composing the `auth` option so credentials such as +// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the +// original value for malformed input so a bad encoding never throws. +const decodeURIComponentSafe = value => { + if (!utils$1.isString(value)) { + return value; + } + try { + return decodeURIComponent(value); + } catch (error) { + return value; + } +}; const test = (fn, ...args) => { try { return !!fn(...args); @@ -41840,6 +42740,14 @@ const test = (fn, ...args) => { return false; } }; +const maybeWithAuthCredentials = url => { + const protocolIndex = url.indexOf('://'); + let urlToCheck = url; + if (protocolIndex !== -1) { + urlToCheck = urlToCheck.slice(protocolIndex + 3); + } + return urlToCheck.includes('@') || urlToCheck.includes(':'); +}; const factory = env => { const globalObject = utils$1.global !== undefined && utils$1.global !== null ? utils$1.global : globalThis; const { @@ -41943,6 +42851,7 @@ const factory = env => { } = resolveConfig(config); const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1; const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1; + const own = key => utils$1.hasOwnProp(config, key) ? config[key] : undefined; let _fetch = envFetch || fetch; responseType = responseType ? (responseType + '').toLowerCase() : 'text'; let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); @@ -41951,7 +42860,46 @@ const factory = env => { composedSignal.unsubscribe(); }); let requestContentLength; + + // AxiosError we raise while the request body is being streamed. Captured + // by identity so the catch block can surface it directly, regardless of + // how the runtime wraps the resulting fetch rejection (undici exposes it + // as `err.cause`; some browsers drop the original error entirely). + let pendingBodyError = null; + const maxBodyLengthError = () => new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, request); try { + // HTTP basic authentication + let auth = undefined; + const configAuth = own('auth'); + if (configAuth) { + const username = utils$1.getSafeProp(configAuth, 'username') || ''; + const password = utils$1.getSafeProp(configAuth, 'password') || ''; + auth = { + username, + password + }; + } + if (maybeWithAuthCredentials(url)) { + const parsedURL = new URL(url, platform.origin); + if (!auth && (parsedURL.username || parsedURL.password)) { + const urlUsername = decodeURIComponentSafe(parsedURL.username); + const urlPassword = decodeURIComponentSafe(parsedURL.password); + auth = { + username: urlUsername, + password: urlPassword + }; + } + if (parsedURL.username || parsedURL.password) { + parsedURL.username = ''; + parsedURL.password = ''; + url = parsedURL.href; + } + } + if (auth) { + headers.delete('authorization'); + headers.set('Authorization', 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || '')))); + } + // Enforce maxContentLength for data: URLs up-front so we never materialize // an oversized payload. The HTTP adapter applies the same check (see http.js // "if (protocol === 'data:')" branch). @@ -41962,30 +42910,54 @@ const factory = env => { } } - // Enforce maxBodyLength against the outbound request body before dispatch. - // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than - // maxBodyLength limit'). Skip when the body length cannot be determined - // (e.g. a live ReadableStream supplied by the caller). + // Enforce maxBodyLength against known-size bodies before dispatch using + // the body's *actual* size — never a caller-declared Content-Length, + // which could under-report to slip an oversized body past the check. + // Unknown-size streams return undefined here and are counted per-chunk + // below as fetch consumes them. if (hasMaxBodyLength && method !== 'get' && method !== 'head') { - const outboundLength = await resolveBodyLength(headers, data); - if (typeof outboundLength === 'number' && isFinite(outboundLength) && outboundLength > maxBodyLength) { - throw new AxiosError('Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config, request); + const outboundLength = await getBodyLength(data); + if (typeof outboundLength === 'number' && isFinite(outboundLength)) { + requestContentLength = outboundLength; + if (outboundLength > maxBodyLength) { + throw maxBodyLengthError(); + } } } - if (onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) { - let _request = new Request(url, { - method: 'POST', - body: data, - duplex: 'half' - }); - let contentTypeHeader; - if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { - headers.setContentType(contentTypeHeader); + + // A streamed body under maxBodyLength must be counted as fetch consumes + // it; its size is never trusted from a caller-declared Content-Length. + const mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data)); + const trackRequestStream = (stream, onProgress, flush) => trackStream(stream, DEFAULT_CHUNK_SIZE, loadedBytes => { + if (hasMaxBodyLength && loadedBytes > maxBodyLength) { + throw pendingBodyError = maxBodyLengthError(); } - if (_request.body) { - const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))); - data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + onProgress && onProgress(loadedBytes); + }, flush); + if (supportsRequestStream && method !== 'get' && method !== 'head' && (onUploadProgress || mustEnforceStreamBody)) { + requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength; + + // A declared length of 0 is only trusted to skip the wrap when we are + // not enforcing a stream limit (which must not rely on that header). + if (requestContentLength !== 0 || mustEnforceStreamBody) { + let _request = new Request(url, { + method: 'POST', + body: data, + duplex: 'half' + }); + let contentTypeHeader; + if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { + headers.setContentType(contentTypeHeader); + } + if (_request.body) { + const [onProgress, flush] = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || []; + data = trackRequestStream(_request.body, onProgress, flush); + } } + } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== 'get' && method !== 'head') { + data = trackRequestStream(data); + } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== 'get' && method !== 'head') { + throw new AxiosError('Stream request bodies are not supported by the current fetch implementation', AxiosError.ERR_NOT_SUPPORT, config, request); } if (!utils$1.isString(withCredentials)) { withCredentials = withCredentials ? 'include' : 'omit'; @@ -42017,11 +42989,12 @@ const factory = env => { }; request = isRequestSupported && new Request(url, resolvedOptions); let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); + const responseHeaders = AxiosHeaders.from(response.headers); // Cheap pre-check: if the server honestly declares a content-length that // already exceeds the cap, reject before we start streaming. if (hasMaxContentLength) { - const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length')); + const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); if (declaredLength != null && declaredLength > maxContentLength) { throw new AxiosError('maxContentLength size of ' + maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, request); } @@ -42032,7 +43005,7 @@ const factory = env => { ['status', 'statusText', 'headers'].forEach(prop => { options[prop] = response[prop]; }); - const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length')); + const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength()); const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || []; let bytesRead = 0; const onChunkProgress = loadedBytes => { @@ -42091,13 +43064,48 @@ const factory = env => { const canceledError = composedSignal.reason; canceledError.config = config; request && (canceledError.request = request); - err !== canceledError && (canceledError.cause = err); + if (err !== canceledError) { + // Non-enumerable to match native Error `cause` semantics so loggers + // don't recurse into circular fetch internals (see #7205). + Object.defineProperty(canceledError, 'cause', { + __proto__: null, + value: err, + writable: true, + enumerable: false, + configurable: true + }); + } throw canceledError; } + + // Surface a maxBodyLength violation we raised while the request body was + // being streamed. Matching by identity (rather than reading + // `err.cause.isAxiosError`) keeps the error deterministic across runtimes + // and avoids both prototype-pollution reads and mis-attributing a foreign + // AxiosError that merely happened to land in `err.cause`. + if (pendingBodyError) { + request && !pendingBodyError.request && (pendingBodyError.request = request); + throw pendingBodyError; + } + + // Re-throw AxiosErrors we raised synchronously (data: URL / content-length + // pre-checks, response size enforcement) without re-wrapping them. + if (err instanceof AxiosError) { + request && !err.request && (err.request = request); + throw err; + } if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { - throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response), { - cause: err.cause || err + const networkError = new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response); + // Non-enumerable to match native Error `cause` semantics so loggers + // don't recurse into circular fetch internals (see #7205). + Object.defineProperty(networkError, 'cause', { + __proto__: null, + value: err.cause || err, + writable: true, + enumerable: false, + configurable: true }); + throw networkError; } throw AxiosError.from(err, err && err.code, config, request, err && err.response); } @@ -42216,7 +43224,7 @@ function getAdapter(adapters, config) { if (!adapter) { const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? 'is not supported by the environment' : 'is not available in the build')); let s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified'; - throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, 'ERR_NOT_SUPPORT'); + throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, AxiosError.ERR_NOT_SUPPORT); } return adapter; } @@ -42359,7 +43367,7 @@ validators$1.spelling = function spelling(correctSpelling) { */ function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { + if (typeof options !== 'object' || options === null) { throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); } const keys = Object.keys(options); @@ -42468,7 +43476,9 @@ class Axios { silentJSONParsing: validators.transitional(validators.boolean), forcedJSONParsing: validators.transitional(validators.boolean), clarifyTimeoutError: validators.transitional(validators.boolean), - legacyInterceptorReqResOrdering: validators.transitional(validators.boolean) + legacyInterceptorReqResOrdering: validators.transitional(validators.boolean), + advertiseZstdAcceptEncoding: validators.transitional(validators.boolean), + validateStatusUndefinedResolves: validators.transitional(validators.boolean) }, false); } if (paramsSerializer != null) { @@ -42545,16 +43555,29 @@ class Axios { const onFulfilled = requestInterceptorChain[i++]; const onRejected = requestInterceptorChain[i++]; try { - newConfig = onFulfilled(newConfig); + newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig; } catch (error) { - onRejected.call(this, error); + if (!onRejected) { + promise = Promise.reject(error); + break; + } + try { + const rejectedResult = onRejected.call(this, error); + if (utils$1.isThenable(rejectedResult)) { + promise = Promise.resolve(rejectedResult).then(() => dispatchRequest.call(this, newConfig)); + } + } catch (rejectedError) { + promise = Promise.reject(rejectedError); + } break; } } - try { - promise = dispatchRequest.call(this, newConfig); - } catch (error) { - return Promise.reject(error); + if (!promise) { + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + promise = Promise.reject(error); + } } i = 0; len = responseInterceptorChain.length; @@ -42565,7 +43588,7 @@ class Axios { } getUri(config) { config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config); return buildURL(fullPath, config.params, config.paramsSerializer); } } @@ -42577,7 +43600,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa return this.request(mergeConfig(config || {}, { method, url, - data: (config || {}).data + data: config && utils$1.hasOwnProp(config, 'data') ? config.data : undefined })); }; }); @@ -42820,6 +43843,7 @@ const HttpStatusCode = { LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511, + WebServerReturnsAnUnknownError: 520, WebServerIsDown: 521, ConnectionTimedOut: 522, OriginIsUnreachable: 523, @@ -42896,7 +43920,6 @@ axios.HttpStatusCode = HttpStatusCode; axios.default = axios; module.exports = axios; -//# sourceMappingURL=axios.cjs.map /***/ }), diff --git a/validate-sbom/dist/index.js b/validate-sbom/dist/index.js index 47bbc1f..dd6aee2 100644 --- a/validate-sbom/dist/index.js +++ b/validate-sbom/dist/index.js @@ -2398,7 +2398,7 @@ exports.getProxyAgentDispatcher = getProxyAgentDispatcher; exports.getProxyFetch = getProxyFetch; exports.getApiBaseUrl = getApiBaseUrl; const httpClient = __importStar(__nccwpck_require__(5270)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -2650,7 +2650,7 @@ const http = __importStar(__nccwpck_require__(8611)); const https = __importStar(__nccwpck_require__(5692)); const pm = __importStar(__nccwpck_require__(9154)); const tunnel = __importStar(__nccwpck_require__(2695)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -4269,34 +4269,34 @@ exports.debug = debug; // for test /***/ }), -/***/ 9280: +/***/ 4782: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Client = __nccwpck_require__(5621) -const Dispatcher = __nccwpck_require__(6307) -const Pool = __nccwpck_require__(1748) -const BalancedPool = __nccwpck_require__(9717) -const Agent = __nccwpck_require__(8717) -const ProxyAgent = __nccwpck_require__(4800) -const EnvHttpProxyAgent = __nccwpck_require__(6753) -const RetryAgent = __nccwpck_require__(6770) -const errors = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +const Client = __nccwpck_require__(8223) +const Dispatcher = __nccwpck_require__(5353) +const Pool = __nccwpck_require__(5326) +const BalancedPool = __nccwpck_require__(9159) +const Agent = __nccwpck_require__(1891) +const ProxyAgent = __nccwpck_require__(5678) +const EnvHttpProxyAgent = __nccwpck_require__(7227) +const RetryAgent = __nccwpck_require__(8792) +const errors = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { InvalidArgumentError } = errors -const api = __nccwpck_require__(9719) -const buildConnector = __nccwpck_require__(6768) -const MockClient = __nccwpck_require__(4997) -const MockAgent = __nccwpck_require__(8269) -const MockPool = __nccwpck_require__(1828) -const mockErrors = __nccwpck_require__(93) -const RetryHandler = __nccwpck_require__(2728) -const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(197) -const DecoratorHandler = __nccwpck_require__(2587) -const RedirectHandler = __nccwpck_require__(5458) -const createRedirectInterceptor = __nccwpck_require__(7780) +const api = __nccwpck_require__(497) +const buildConnector = __nccwpck_require__(5634) +const MockClient = __nccwpck_require__(3735) +const MockAgent = __nccwpck_require__(3627) +const MockPool = __nccwpck_require__(6134) +const mockErrors = __nccwpck_require__(9539) +const RetryHandler = __nccwpck_require__(8022) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(6759) +const DecoratorHandler = __nccwpck_require__(3253) +const RedirectHandler = __nccwpck_require__(9104) +const createRedirectInterceptor = __nccwpck_require__(5914) Object.assign(Dispatcher.prototype, api) @@ -4314,10 +4314,10 @@ module.exports.DecoratorHandler = DecoratorHandler module.exports.RedirectHandler = RedirectHandler module.exports.createRedirectInterceptor = createRedirectInterceptor module.exports.interceptors = { - redirect: __nccwpck_require__(7594), - retry: __nccwpck_require__(9722), - dump: __nccwpck_require__(4972), - dns: __nccwpck_require__(4411) + redirect: __nccwpck_require__(2524), + retry: __nccwpck_require__(2644), + dump: __nccwpck_require__(6141), + dns: __nccwpck_require__(9765) } module.exports.buildConnector = buildConnector @@ -4379,7 +4379,7 @@ function makeDispatcher (fn) { module.exports.setGlobalDispatcher = setGlobalDispatcher module.exports.getGlobalDispatcher = getGlobalDispatcher -const fetchImpl = (__nccwpck_require__(782).fetch) +const fetchImpl = (__nccwpck_require__(5404).fetch) module.exports.fetch = async function fetch (init, options = undefined) { try { return await fetchImpl(init, options) @@ -4391,39 +4391,39 @@ module.exports.fetch = async function fetch (init, options = undefined) { throw err } } -module.exports.Headers = __nccwpck_require__(6548).Headers -module.exports.Response = __nccwpck_require__(2603).Response -module.exports.Request = __nccwpck_require__(6607).Request -module.exports.FormData = __nccwpck_require__(2198).FormData +module.exports.Headers = __nccwpck_require__(4478).Headers +module.exports.Response = __nccwpck_require__(5093).Response +module.exports.Request = __nccwpck_require__(2257).Request +module.exports.FormData = __nccwpck_require__(7064).FormData module.exports.File = globalThis.File ?? (__nccwpck_require__(4573).File) -module.exports.FileReader = __nccwpck_require__(9395).FileReader +module.exports.FileReader = __nccwpck_require__(6705).FileReader -const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(5699) +const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(7573) module.exports.setGlobalOrigin = setGlobalOrigin module.exports.getGlobalOrigin = getGlobalOrigin -const { CacheStorage } = __nccwpck_require__(8733) -const { kConstruct } = __nccwpck_require__(2045) +const { CacheStorage } = __nccwpck_require__(2363) +const { kConstruct } = __nccwpck_require__(4527) // Cache & CacheStorage are tightly coupled with fetch. Even if it may run // in an older version of Node, it doesn't have any use without fetch. module.exports.caches = new CacheStorage(kConstruct) -const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1973) +const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(6783) module.exports.deleteCookie = deleteCookie module.exports.getCookies = getCookies module.exports.getSetCookies = getSetCookies module.exports.setCookie = setCookie -const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(8828) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4622) module.exports.parseMIMEType = parseMIMEType module.exports.serializeAMimeType = serializeAMimeType -const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(8916) -module.exports.WebSocket = __nccwpck_require__(5134).WebSocket +const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(4926) +module.exports.WebSocket = __nccwpck_require__(9480).WebSocket module.exports.CloseEvent = CloseEvent module.exports.ErrorEvent = ErrorEvent module.exports.MessageEvent = MessageEvent @@ -4439,18 +4439,18 @@ module.exports.MockPool = MockPool module.exports.MockAgent = MockAgent module.exports.mockErrors = mockErrors -const { EventSource } = __nccwpck_require__(4886) +const { EventSource } = __nccwpck_require__(5768) module.exports.EventSource = EventSource /***/ }), -/***/ 1006: +/***/ 6720: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { addAbortListener } = __nccwpck_require__(3792) -const { RequestAbortedError } = __nccwpck_require__(9715) +const { addAbortListener } = __nccwpck_require__(2250) +const { RequestAbortedError } = __nccwpck_require__(7617) const kListener = Symbol('kListener') const kSignal = Symbol('kSignal') @@ -4510,7 +4510,7 @@ module.exports = { /***/ }), -/***/ 2772: +/***/ 6958: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4518,9 +4518,9 @@ module.exports = { const assert = __nccwpck_require__(4589) const { AsyncResource } = __nccwpck_require__(6698) -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class ConnectHandler extends AsyncResource { constructor (opts, callback) { @@ -4626,7 +4626,7 @@ module.exports = connect /***/ }), -/***/ 2846: +/***/ 8084: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4641,10 +4641,10 @@ const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) const kResume = Symbol('resume') @@ -4885,17 +4885,17 @@ module.exports = pipeline /***/ }), -/***/ 8875: +/***/ 353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { Readable } = __nccwpck_require__(3159) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { Readable } = __nccwpck_require__(105) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) class RequestHandler extends AsyncResource { @@ -5107,7 +5107,7 @@ module.exports.RequestHandler = RequestHandler /***/ }), -/***/ 9560: +/***/ 7010: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -5115,11 +5115,11 @@ module.exports.RequestHandler = RequestHandler const assert = __nccwpck_require__(4589) const { finished, PassThrough } = __nccwpck_require__(7075) -const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { @@ -5335,16 +5335,16 @@ module.exports = stream /***/ }), -/***/ 6538: +/***/ 7312: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) const { AsyncResource } = __nccwpck_require__(6698) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) class UpgradeHandler extends AsyncResource { @@ -5451,22 +5451,22 @@ module.exports = upgrade /***/ }), -/***/ 9719: +/***/ 497: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports.request = __nccwpck_require__(8875) -module.exports.stream = __nccwpck_require__(9560) -module.exports.pipeline = __nccwpck_require__(2846) -module.exports.upgrade = __nccwpck_require__(6538) -module.exports.connect = __nccwpck_require__(2772) +module.exports.request = __nccwpck_require__(353) +module.exports.stream = __nccwpck_require__(7010) +module.exports.pipeline = __nccwpck_require__(8084) +module.exports.upgrade = __nccwpck_require__(7312) +module.exports.connect = __nccwpck_require__(6958) /***/ }), -/***/ 3159: +/***/ 105: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -5476,9 +5476,9 @@ module.exports.connect = __nccwpck_require__(2772) const assert = __nccwpck_require__(4589) const { Readable } = __nccwpck_require__(7075) -const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { ReadableStreamFrom } = __nccwpck_require__(3792) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { ReadableStreamFrom } = __nccwpck_require__(2250) const kConsume = Symbol('kConsume') const kReading = Symbol('kReading') @@ -5859,15 +5859,15 @@ module.exports = { Readable: BodyReadable, chunksDecode } /***/ }), -/***/ 343: +/***/ 1337: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) const { ResponseStatusCodeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) -const { chunksDecode } = __nccwpck_require__(3159) +const { chunksDecode } = __nccwpck_require__(105) const CHUNK_LIMIT = 128 * 1024 async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { @@ -5959,7 +5959,7 @@ module.exports = { /***/ }), -/***/ 6768: +/***/ 5634: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -5967,9 +5967,9 @@ module.exports = { const net = __nccwpck_require__(7030) const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(9715) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(7617) +const timers = __nccwpck_require__(2841) function noop () {} @@ -6207,7 +6207,7 @@ module.exports = buildConnector /***/ }), -/***/ 2239: +/***/ 885: /***/ ((module) => { "use strict"; @@ -6333,7 +6333,7 @@ module.exports = { /***/ }), -/***/ 7822: +/***/ 6692: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -6543,7 +6543,7 @@ module.exports = { /***/ }), -/***/ 9715: +/***/ 7617: /***/ ((module) => { "use strict"; @@ -6976,7 +6976,7 @@ module.exports = { /***/ }), -/***/ 8655: +/***/ 7533: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -6985,7 +6985,7 @@ module.exports = { const { InvalidArgumentError, NotSupportedError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const assert = __nccwpck_require__(4589) const { isValidHTTPToken, @@ -7000,9 +7000,9 @@ const { validateHandler, getServerName, normalizedMethodRecords -} = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) +} = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) // Verifies that a given path is valid does not contain control chars \x00 to \x20 const invalidPathRegex = /[^\u0021-\u00ff]/ @@ -7389,7 +7389,7 @@ module.exports = Request /***/ }), -/***/ 1675: +/***/ 8705: /***/ ((module) => { module.exports = { @@ -7463,7 +7463,7 @@ module.exports = { /***/ }), -/***/ 4184: +/***/ 8174: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -7472,7 +7472,7 @@ module.exports = { const { wellknownHeaderNames, headerNameLowerCasedRecord -} = __nccwpck_require__(2239) +} = __nccwpck_require__(885) class TstNode { /** @type {any} */ @@ -7623,14 +7623,14 @@ module.exports = { /***/ }), -/***/ 3792: +/***/ 2250: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(1675) +const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(8705) const { IncomingMessage } = __nccwpck_require__(7067) const stream = __nccwpck_require__(7075) const net = __nccwpck_require__(7030) @@ -7638,9 +7638,9 @@ const { Blob } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) const { stringify } = __nccwpck_require__(1792) const { EventEmitter: EE } = __nccwpck_require__(8474) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) -const { tree } = __nccwpck_require__(4184) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) +const { tree } = __nccwpck_require__(8174) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) @@ -8350,19 +8350,19 @@ module.exports = { /***/ }), -/***/ 8717: +/***/ 1891: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) -const DispatcherBase = __nccwpck_require__(9921) -const Pool = __nccwpck_require__(1748) -const Client = __nccwpck_require__(5621) -const util = __nccwpck_require__(3792) -const createRedirectInterceptor = __nccwpck_require__(7780) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) +const DispatcherBase = __nccwpck_require__(2403) +const Pool = __nccwpck_require__(5326) +const Client = __nccwpck_require__(8223) +const util = __nccwpck_require__(2250) +const createRedirectInterceptor = __nccwpck_require__(5914) const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') @@ -8380,7 +8380,6 @@ function defaultFactory (origin, opts) { class Agent extends DispatcherBase { constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } @@ -8488,7 +8487,7 @@ module.exports = Agent /***/ }), -/***/ 9717: +/***/ 9159: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -8497,7 +8496,7 @@ module.exports = Agent const { BalancedPoolMissingUpstreamError, InvalidArgumentError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { PoolBase, kClients, @@ -8505,10 +8504,10 @@ const { kAddClient, kRemoveClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Pool = __nccwpck_require__(1748) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const { parseOrigin } = __nccwpck_require__(3792) +} = __nccwpck_require__(7262) +const Pool = __nccwpck_require__(5326) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const { parseOrigin } = __nccwpck_require__(2250) const kFactory = Symbol('factory') const kOptions = Symbol('options') @@ -8705,7 +8704,7 @@ module.exports = BalancedPool /***/ }), -/***/ 2285: +/***/ 8875: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -8714,9 +8713,9 @@ module.exports = BalancedPool /* global WebAssembly */ const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const timers = __nccwpck_require__(2841) const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, @@ -8728,7 +8727,7 @@ const { BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -8761,22 +8760,25 @@ const { kOnError, kResume, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) -const constants = __nccwpck_require__(9368) +const constants = __nccwpck_require__(6882) const EMPTY_BUF = Buffer.alloc(0) const FastBuffer = Buffer[Symbol.species] const addListener = util.addListener const removeAllListeners = util.removeAllListeners +const kIdleSocketValidation = Symbol('kIdleSocketValidation') +const kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout') +const kSocketUsed = Symbol('kSocketUsed') let extractBody async function lazyllhttp () { - const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(798) : undefined + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(4728) : undefined let mod try { - mod = await WebAssembly.compile(__nccwpck_require__(4682)) + mod = await WebAssembly.compile(__nccwpck_require__(5984)) } catch (e) { /* istanbul ignore next */ @@ -8784,7 +8786,7 @@ async function lazyllhttp () { // being enabled, but the occurring of this other error // * https://github.com/emscripten-core/emscripten/issues/11495 // got me to remove that check to avoid breaking Node 12. - mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(798)) + mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(4728)) } return await WebAssembly.instantiate(mod, { @@ -8990,29 +8992,71 @@ class Parser { const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr - if (ret === constants.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(data.slice(offset)) - } else if (ret === constants.ERROR.PAUSED) { - this.paused = true - socket.unshift(data.slice(offset)) - } else if (ret !== constants.ERROR.OK) { - const ptr = llhttp.llhttp_get_error_reason(this.ptr) - let message = '' - /* istanbul ignore else: difficult to make a test case for */ - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) - message = - 'Response does not match the HTTP/1.1 protocol (' + - Buffer.from(llhttp.memory.buffer, ptr, len).toString() + - ')' - } - throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + if (ret !== constants.ERROR.OK) { + const body = data.subarray(offset) + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(body) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(body) + } else { + throw this.createError(ret, body) + } } } catch (err) { util.destroy(socket, err) } } + finish () { + assert(currentParser === null) + assert(this.ptr != null) + assert(!this.paused) + + const { llhttp } = this + + let ret + + try { + currentParser = this + ret = llhttp.llhttp_finish(this.ptr) + } finally { + currentParser = null + } + + if (ret === constants.ERROR.OK) { + return null + } + + if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { + this.paused = true + return null + } + + return this.createError(ret, EMPTY_BUF) + } + + createError (ret, data) { + const { llhttp, contentLength, bytesRead } = this + + if (contentLength && bytesRead !== parseInt(contentLength, 10)) { + return new ResponseContentLengthMismatchError() + } + + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + + return new HTTPParserError(message, constants.ERROR[ret], data) + } + destroy () { assert(this.ptr != null) assert(currentParser == null) @@ -9040,6 +9084,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] if (!request) { return -1 @@ -9143,6 +9192,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] /* istanbul ignore next: difficult to make a test case for */ @@ -9316,6 +9370,7 @@ class Parser { request.onComplete(headers) client[kQueue][client[kRunningIdx]++] = null + socket[kSocketUsed] = true if (socket[kWriting]) { assert(client[kRunning] === 0) @@ -9374,6 +9429,9 @@ async function connectH1 (client, socket) { socket[kWriting] = false socket[kReset] = false socket[kBlocking] = false + socket[kIdleSocketValidation] = 0 + socket[kIdleSocketValidationTimeout] = null + socket[kSocketUsed] = false socket[kParser] = new Parser(client, socket, llhttpInstance) addListener(socket, 'error', function (err) { @@ -9384,8 +9442,11 @@ async function connectH1 (client, socket) { // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded // to the user. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so for as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + this[kError] = parserErr + this[kClient][kOnError](parserErr) + } return } @@ -9404,8 +9465,10 @@ async function connectH1 (client, socket) { const parser = this[kParser] if (parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + util.destroy(this, parserErr) + } return } @@ -9415,10 +9478,11 @@ async function connectH1 (client, socket) { const client = this[kClient] const parser = this[kParser] + clearIdleSocketValidation(this) + if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + this[kError] = parser.finish() || this[kError] } this[kParser].destroy() @@ -9481,7 +9545,7 @@ async function connectH1 (client, socket) { return socket.destroyed }, busy (request) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) { return true } @@ -9519,6 +9583,31 @@ async function connectH1 (client, socket) { } } +function clearIdleSocketValidation (socket) { + if (socket[kIdleSocketValidationTimeout]) { + clearTimeout(socket[kIdleSocketValidationTimeout]) + socket[kIdleSocketValidationTimeout] = null + } + + socket[kIdleSocketValidation] = 0 +} + +function scheduleIdleSocketValidation (client, socket) { + socket[kIdleSocketValidation] = 1 + socket[kIdleSocketValidationTimeout] = setTimeout(() => { + socket[kIdleSocketValidationTimeout] = null + socket[kIdleSocketValidation] = 2 + + if (client[kSocket] === socket && !socket.destroyed) { + client[kResume]() + } + }, 0) + socket[kIdleSocketValidationTimeout].unref?.() +} + +/** + * @param {import('./client.js')} client + */ function resumeH1 (client) { const socket = client[kSocket] @@ -9533,6 +9622,32 @@ function resumeH1 (client) { socket[kNoRef] = false } + if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) { + if (socket[kIdleSocketValidation] === 0) { + scheduleIdleSocketValidation(client, socket) + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + + if (socket[kIdleSocketValidation] === 1) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + } + + if (client[kRunning] === 0) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + } + if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE) @@ -9579,7 +9694,7 @@ function writeH1 (client, request) { if (util.isFormDataLike(body)) { if (!extractBody) { - extractBody = (__nccwpck_require__(220).extractBody) + extractBody = (__nccwpck_require__(3682).extractBody) } const [bodyStream, contentType] = extractBody(body) @@ -9626,6 +9741,7 @@ function writeH1 (client, request) { } const socket = client[kSocket] + clearIdleSocketValidation(socket) const abort = (err) => { if (request.aborted || request.completed) { @@ -10083,7 +10199,7 @@ module.exports = connectH1 /***/ }), -/***/ 4164: +/***/ 7662: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10091,13 +10207,13 @@ module.exports = connectH1 const assert = __nccwpck_require__(4589) const { pipeline } = __nccwpck_require__(7075) -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -10116,7 +10232,7 @@ const { kResume, kSize, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) const kOpenStreams = Symbol('open streams') @@ -10475,7 +10591,7 @@ function writeH2 (client, request) { let contentLength = util.bodyLength(body) if (util.isFormDataLike(body)) { - extractBody ??= (__nccwpck_require__(220).extractBody) + extractBody ??= (__nccwpck_require__(3682).extractBody) const [bodyStream, contentType] = extractBody(body) headers['content-type'] = contentType @@ -10835,7 +10951,7 @@ module.exports = connectH2 /***/ }), -/***/ 5621: +/***/ 8223: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10846,16 +10962,16 @@ module.exports = connectH2 const assert = __nccwpck_require__(4589) const net = __nccwpck_require__(7030) const http = __nccwpck_require__(7067) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const Request = __nccwpck_require__(8655) -const DispatcherBase = __nccwpck_require__(9921) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const Request = __nccwpck_require__(7533) +const DispatcherBase = __nccwpck_require__(2403) const { InvalidArgumentError, InformationalError, ClientDestroyedError -} = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) const { kUrl, kServerName, @@ -10897,9 +11013,9 @@ const { kHTTPContext, kMaxConcurrentStreams, kResume -} = __nccwpck_require__(1675) -const connectH1 = __nccwpck_require__(2285) -const connectH2 = __nccwpck_require__(4164) +} = __nccwpck_require__(8705) +const connectH1 = __nccwpck_require__(8875) +const connectH2 = __nccwpck_require__(7662) let deprecatedInterceptorWarned = false const kClosedResolve = Symbol('kClosedResolve') @@ -11206,7 +11322,7 @@ class Client extends DispatcherBase { } } -const createRedirectInterceptor = __nccwpck_require__(7780) +const createRedirectInterceptor = __nccwpck_require__(5914) function onError (client, err) { if ( @@ -11466,19 +11582,19 @@ module.exports = Client /***/ }), -/***/ 9921: +/***/ 2403: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) +const Dispatcher = __nccwpck_require__(5353) const { ClientDestroyedError, ClientClosedError, InvalidArgumentError -} = __nccwpck_require__(9715) -const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(1675) +} = __nccwpck_require__(7617) +const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(8705) const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') @@ -11498,6 +11614,7 @@ class DispatcherBase extends Dispatcher { get webSocketOptions () { return { + maxFragments: this[kWebSocketOptions].maxFragments ?? 131072, maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 } } @@ -11672,7 +11789,7 @@ module.exports = DispatcherBase /***/ }), -/***/ 6307: +/***/ 5353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -11745,16 +11862,16 @@ module.exports = Dispatcher /***/ }), -/***/ 6753: +/***/ 7227: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(1675) -const ProxyAgent = __nccwpck_require__(4800) -const Agent = __nccwpck_require__(8717) +const DispatcherBase = __nccwpck_require__(2403) +const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(8705) +const ProxyAgent = __nccwpck_require__(5678) +const Agent = __nccwpck_require__(1891) const DEFAULT_PORTS = { 'http:': 80, @@ -11913,7 +12030,7 @@ module.exports = EnvHttpProxyAgent /***/ }), -/***/ 8692: +/***/ 894: /***/ ((module) => { "use strict"; @@ -12038,16 +12155,16 @@ module.exports = class FixedQueue { /***/ }), -/***/ 2192: +/***/ 7262: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const FixedQueue = __nccwpck_require__(8692) -const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(1675) -const PoolStats = __nccwpck_require__(206) +const DispatcherBase = __nccwpck_require__(2403) +const FixedQueue = __nccwpck_require__(894) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(8705) +const PoolStats = __nccwpck_require__(3264) const kClients = Symbol('clients') const kNeedDrain = Symbol('needDrain') @@ -12240,10 +12357,10 @@ module.exports = { /***/ }), -/***/ 206: +/***/ 3264: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(1675) +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(8705) const kPool = Symbol('pool') class PoolStats { @@ -12281,7 +12398,7 @@ module.exports = PoolStats /***/ }), -/***/ 1748: +/***/ 5326: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -12293,14 +12410,14 @@ const { kNeedDrain, kAddClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Client = __nccwpck_require__(5621) +} = __nccwpck_require__(7262) +const Client = __nccwpck_require__(8223) const { InvalidArgumentError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const buildConnector = __nccwpck_require__(5634) const kOptions = Symbol('options') const kConnections = Symbol('connections') @@ -12396,20 +12513,20 @@ module.exports = Pool /***/ }), -/***/ 4800: +/***/ 5678: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) +const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) const { URL } = __nccwpck_require__(3136) -const Agent = __nccwpck_require__(8717) -const Pool = __nccwpck_require__(1748) -const DispatcherBase = __nccwpck_require__(9921) -const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) -const Client = __nccwpck_require__(5621) +const Agent = __nccwpck_require__(1891) +const Pool = __nccwpck_require__(5326) +const DispatcherBase = __nccwpck_require__(2403) +const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) +const Client = __nccwpck_require__(8223) const kAgent = Symbol('proxy agent') const kClient = Symbol('proxy client') @@ -12678,14 +12795,14 @@ module.exports = ProxyAgent /***/ }), -/***/ 6770: +/***/ 8792: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) -const RetryHandler = __nccwpck_require__(2728) +const Dispatcher = __nccwpck_require__(5353) +const RetryHandler = __nccwpck_require__(8022) class RetryAgent extends Dispatcher { #agent = null @@ -12721,7 +12838,7 @@ module.exports = RetryAgent /***/ }), -/***/ 197: +/***/ 6759: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -12730,8 +12847,8 @@ module.exports = RetryAgent // We include a version number for the Dispatcher API. In case of breaking changes, // this version number must be increased to avoid conflicts. const globalDispatcher = Symbol.for('undici.globalDispatcher.1') -const { InvalidArgumentError } = __nccwpck_require__(9715) -const Agent = __nccwpck_require__(8717) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const Agent = __nccwpck_require__(1891) if (getGlobalDispatcher() === undefined) { setGlobalDispatcher(new Agent()) @@ -12761,7 +12878,7 @@ module.exports = { /***/ }), -/***/ 2587: +/***/ 3253: /***/ ((module) => { "use strict"; @@ -12813,16 +12930,16 @@ module.exports = class DecoratorHandler { /***/ }), -/***/ 5458: +/***/ 9104: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { kBodyUsed } = __nccwpck_require__(1675) +const util = __nccwpck_require__(2250) +const { kBodyUsed } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) -const { InvalidArgumentError } = __nccwpck_require__(9715) +const { InvalidArgumentError } = __nccwpck_require__(7617) const EE = __nccwpck_require__(8474) const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] @@ -13053,21 +13170,21 @@ module.exports = RedirectHandler /***/ }), -/***/ 2728: +/***/ 8022: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kRetryHandlerDefaultRetry } = __nccwpck_require__(1675) -const { RequestRetryError } = __nccwpck_require__(9715) +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(8705) +const { RequestRetryError } = __nccwpck_require__(7617) const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody -} = __nccwpck_require__(3792) +} = __nccwpck_require__(2250) function calculateRetryAfterHeader (retryAfter) { const current = Date.now() @@ -13435,15 +13552,15 @@ module.exports = RetryHandler /***/ }), -/***/ 4411: +/***/ 9765: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { isIP } = __nccwpck_require__(7030) const { lookup } = __nccwpck_require__(610) -const DecoratorHandler = __nccwpck_require__(2587) -const { InvalidArgumentError, InformationalError } = __nccwpck_require__(9715) +const DecoratorHandler = __nccwpck_require__(3253) +const { InvalidArgumentError, InformationalError } = __nccwpck_require__(7617) const maxInt = Math.pow(2, 31) - 1 class DNSInstance { @@ -13818,15 +13935,15 @@ module.exports = interceptorOpts => { /***/ }), -/***/ 4972: +/***/ 6141: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const DecoratorHandler = __nccwpck_require__(2587) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const DecoratorHandler = __nccwpck_require__(3253) class DumpHandler extends DecoratorHandler { #maxSize = 1024 * 1024 @@ -13949,13 +14066,13 @@ module.exports = createDumpInterceptor /***/ }), -/***/ 7780: +/***/ 5914: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { @@ -13978,12 +14095,12 @@ module.exports = createRedirectInterceptor /***/ }), -/***/ 7594: +/***/ 2524: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) module.exports = opts => { const globalMaxRedirections = opts?.maxRedirections @@ -14010,12 +14127,12 @@ module.exports = opts => { /***/ }), -/***/ 9722: +/***/ 2644: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RetryHandler = __nccwpck_require__(2728) +const RetryHandler = __nccwpck_require__(8022) module.exports = globalOpts => { return dispatch => { @@ -14037,14 +14154,14 @@ module.exports = globalOpts => { /***/ }), -/***/ 9368: +/***/ 6882: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; -const utils_1 = __nccwpck_require__(2316); +const utils_1 = __nccwpck_require__(2234); // C headers var ERROR; (function (ERROR) { @@ -14322,7 +14439,7 @@ exports.SPECIAL_HEADERS = { /***/ }), -/***/ 798: +/***/ 4728: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -14335,7 +14452,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 4682: +/***/ 5984: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -14348,7 +14465,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 2316: +/***/ 2234: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -14370,14 +14487,14 @@ exports.enumToMap = enumToMap; /***/ }), -/***/ 8269: +/***/ 3627: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kClients } = __nccwpck_require__(1675) -const Agent = __nccwpck_require__(8717) +const { kClients } = __nccwpck_require__(8705) +const Agent = __nccwpck_require__(1891) const { kAgent, kMockAgentSet, @@ -14388,14 +14505,14 @@ const { kGetNetConnect, kOptions, kFactory -} = __nccwpck_require__(4093) -const MockClient = __nccwpck_require__(4997) -const MockPool = __nccwpck_require__(1828) -const { matchValue, buildMockOptions } = __nccwpck_require__(3589) -const { InvalidArgumentError, UndiciError } = __nccwpck_require__(9715) -const Dispatcher = __nccwpck_require__(6307) -const Pluralizer = __nccwpck_require__(5097) -const PendingInterceptorsFormatter = __nccwpck_require__(9758) +} = __nccwpck_require__(4251) +const MockClient = __nccwpck_require__(3735) +const MockPool = __nccwpck_require__(6134) +const { matchValue, buildMockOptions } = __nccwpck_require__(6031) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(7617) +const Dispatcher = __nccwpck_require__(5353) +const Pluralizer = __nccwpck_require__(1591) +const PendingInterceptorsFormatter = __nccwpck_require__(9236) class MockAgent extends Dispatcher { constructor (opts) { @@ -14538,15 +14655,15 @@ module.exports = MockAgent /***/ }), -/***/ 4997: +/***/ 3735: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Client = __nccwpck_require__(5621) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Client = __nccwpck_require__(8223) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -14555,10 +14672,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockClient provides an API that extends the Client to influence the mockDispatches. @@ -14605,13 +14722,13 @@ module.exports = MockClient /***/ }), -/***/ 93: +/***/ 9539: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { UndiciError } = __nccwpck_require__(9715) +const { UndiciError } = __nccwpck_require__(7617) const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED') @@ -14641,13 +14758,13 @@ module.exports = { /***/ }), -/***/ 6039: +/***/ 3969: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3589) +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kDispatchKey, @@ -14655,9 +14772,9 @@ const { kDefaultTrailers, kContentLength, kMockDispatch -} = __nccwpck_require__(4093) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { buildURL } = __nccwpck_require__(2250) /** * Defines the scope API for an interceptor reply @@ -14856,15 +14973,15 @@ module.exports.MockScope = MockScope /***/ }), -/***/ 1828: +/***/ 6134: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Pool = __nccwpck_require__(1748) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Pool = __nccwpck_require__(5326) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -14873,10 +14990,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockPool provides an API that extends the Pool to influence the mockDispatches. @@ -14923,7 +15040,7 @@ module.exports = MockPool /***/ }), -/***/ 4093: +/***/ 4251: /***/ ((module) => { "use strict"; @@ -14954,21 +15071,21 @@ module.exports = { /***/ }), -/***/ 3589: +/***/ 6031: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { MockNotMatchedError } = __nccwpck_require__(93) +const { MockNotMatchedError } = __nccwpck_require__(9539) const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect -} = __nccwpck_require__(4093) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { buildURL } = __nccwpck_require__(2250) const { STATUS_CODES } = __nccwpck_require__(7067) const { types: { @@ -15329,7 +15446,7 @@ module.exports = { /***/ }), -/***/ 9758: +/***/ 9236: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -15380,7 +15497,7 @@ module.exports = class PendingInterceptorsFormatter { /***/ }), -/***/ 5097: +/***/ 1591: /***/ ((module) => { "use strict"; @@ -15417,7 +15534,7 @@ module.exports = class Pluralizer { /***/ }), -/***/ 1915: +/***/ 2841: /***/ ((module) => { "use strict"; @@ -15848,21 +15965,21 @@ module.exports = { /***/ }), -/***/ 5714: +/***/ 9556: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { urlEquals, getFieldValues } = __nccwpck_require__(8094) -const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3792) -const { webidl } = __nccwpck_require__(613) -const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(2603) -const { Request, fromInnerRequest } = __nccwpck_require__(6607) -const { kState } = __nccwpck_require__(2043) -const { fetching } = __nccwpck_require__(782) -const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9808) +const { kConstruct } = __nccwpck_require__(4527) +const { urlEquals, getFieldValues } = __nccwpck_require__(7900) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(2250) +const { webidl } = __nccwpck_require__(4195) +const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(5093) +const { Request, fromInnerRequest } = __nccwpck_require__(2257) +const { kState } = __nccwpck_require__(4701) +const { fetching } = __nccwpck_require__(5404) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9614) const assert = __nccwpck_require__(4589) /** @@ -16715,16 +16832,16 @@ module.exports = { /***/ }), -/***/ 8733: +/***/ 2363: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { Cache } = __nccwpck_require__(5714) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(4527) +const { Cache } = __nccwpck_require__(9556) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class CacheStorage { /** @@ -16875,28 +16992,28 @@ module.exports = { /***/ }), -/***/ 2045: +/***/ 4527: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - kConstruct: (__nccwpck_require__(1675).kConstruct) + kConstruct: (__nccwpck_require__(8705).kConstruct) } /***/ }), -/***/ 8094: +/***/ 7900: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { URLSerializer } = __nccwpck_require__(8828) -const { isValidHeaderName } = __nccwpck_require__(9808) +const { URLSerializer } = __nccwpck_require__(4622) +const { isValidHeaderName } = __nccwpck_require__(9614) /** * @see https://url.spec.whatwg.org/#concept-url-equals @@ -16941,7 +17058,7 @@ module.exports = { /***/ }), -/***/ 924: +/***/ 8498: /***/ ((module) => { "use strict"; @@ -16961,16 +17078,16 @@ module.exports = { /***/ }), -/***/ 1973: +/***/ 6783: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { parseSetCookie } = __nccwpck_require__(3498) -const { stringify } = __nccwpck_require__(4533) -const { webidl } = __nccwpck_require__(613) -const { Headers } = __nccwpck_require__(6548) +const { parseSetCookie } = __nccwpck_require__(9032) +const { stringify } = __nccwpck_require__(6095) +const { webidl } = __nccwpck_require__(4195) +const { Headers } = __nccwpck_require__(4478) /** * @typedef {Object} Cookie @@ -17153,15 +17270,15 @@ module.exports = { /***/ }), -/***/ 3498: +/***/ 9032: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(924) -const { isCTLExcludingHtab } = __nccwpck_require__(4533) -const { collectASequenceOfCodePointsFast } = __nccwpck_require__(8828) +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(8498) +const { isCTLExcludingHtab } = __nccwpck_require__(6095) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4622) const assert = __nccwpck_require__(4589) /** @@ -17434,32 +17551,25 @@ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) // If the attribute-name case-insensitively matches the string // "SameSite", the user agent MUST process the cookie-av as follows: - // 1. Let enforcement be "Default". - let enforcement = 'Default' - const attributeValueLowercase = attributeValue.toLowerCase() - // 2. If cookie-av's attribute-value is a case-insensitive match for - // "None", set enforcement to "None". - if (attributeValueLowercase.includes('none')) { - enforcement = 'None' - } - // 3. If cookie-av's attribute-value is a case-insensitive match for - // "Strict", set enforcement to "Strict". - if (attributeValueLowercase.includes('strict')) { - enforcement = 'Strict' + // 1. If cookie-av's attribute-value is a case-insensitive match for + // "None", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "None". + if (attributeValueLowercase === 'none') { + cookieAttributeList.sameSite = 'None' + } else if (attributeValueLowercase === 'strict') { + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", append an attribute to the cookie-attribute-list with + // an attribute-name of "SameSite" and an attribute-value of + // "Strict". + cookieAttributeList.sameSite = 'Strict' + } else if (attributeValueLowercase === 'lax') { + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "Lax". + cookieAttributeList.sameSite = 'Lax' } - - // 4. If cookie-av's attribute-value is a case-insensitive match for - // "Lax", set enforcement to "Lax". - if (attributeValueLowercase.includes('lax')) { - enforcement = 'Lax' - } - - // 5. Append an attribute to the cookie-attribute-list with an - // attribute-name of "SameSite" and an attribute-value of - // enforcement. - cookieAttributeList.sameSite = enforcement } else { cookieAttributeList.unparsed ??= [] @@ -17478,7 +17588,7 @@ module.exports = { /***/ }), -/***/ 4533: +/***/ 6095: /***/ ((module) => { "use strict"; @@ -17768,13 +17878,13 @@ module.exports = { /***/ }), -/***/ 8735: +/***/ 1581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Transform } = __nccwpck_require__(7075) -const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(3867) +const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5537) /** * @type {number[]} BOM @@ -18174,23 +18284,23 @@ module.exports = { /***/ }), -/***/ 4886: +/***/ 5768: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { pipeline } = __nccwpck_require__(7075) -const { fetching } = __nccwpck_require__(782) -const { makeRequest } = __nccwpck_require__(6607) -const { webidl } = __nccwpck_require__(613) -const { EventSourceStream } = __nccwpck_require__(8735) -const { parseMIMEType } = __nccwpck_require__(8828) -const { createFastMessageEvent } = __nccwpck_require__(8916) -const { isNetworkError } = __nccwpck_require__(2603) -const { delay } = __nccwpck_require__(3867) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { environmentSettingsObject } = __nccwpck_require__(9808) +const { fetching } = __nccwpck_require__(5404) +const { makeRequest } = __nccwpck_require__(2257) +const { webidl } = __nccwpck_require__(4195) +const { EventSourceStream } = __nccwpck_require__(1581) +const { parseMIMEType } = __nccwpck_require__(4622) +const { createFastMessageEvent } = __nccwpck_require__(4926) +const { isNetworkError } = __nccwpck_require__(5093) +const { delay } = __nccwpck_require__(5537) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { environmentSettingsObject } = __nccwpck_require__(9614) let experimentalWarned = false @@ -18662,7 +18772,7 @@ module.exports = { /***/ }), -/***/ 3867: +/***/ 5537: /***/ ((module) => { "use strict"; @@ -18707,13 +18817,13 @@ module.exports = { /***/ }), -/***/ 220: +/***/ 3682: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { ReadableStreamFrom, isBlobLike, @@ -18723,16 +18833,16 @@ const { fullyReadBody, extractMimeType, utf8DecodeBytes -} = __nccwpck_require__(9808) -const { FormData } = __nccwpck_require__(2198) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { FormData } = __nccwpck_require__(7064) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) const { Blob } = __nccwpck_require__(4573) const assert = __nccwpck_require__(4589) const { isErrored, isDisturbed } = __nccwpck_require__(7075) const { isArrayBuffer } = __nccwpck_require__(3429) -const { serializeAMimeType } = __nccwpck_require__(8828) -const { multipartFormDataParser } = __nccwpck_require__(6052) +const { serializeAMimeType } = __nccwpck_require__(4622) +const { multipartFormDataParser } = __nccwpck_require__(5670) let random try { @@ -19244,7 +19354,7 @@ module.exports = { /***/ }), -/***/ 1935: +/***/ 3169: /***/ ((module) => { "use strict"; @@ -19376,7 +19486,7 @@ module.exports = { /***/ }), -/***/ 8828: +/***/ 4622: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -20128,13 +20238,13 @@ module.exports = { /***/ }), -/***/ 125: +/***/ 3207: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConnected, kSize } = __nccwpck_require__(1675) +const { kConnected, kSize } = __nccwpck_require__(8705) class CompatWeakRef { constructor (value) { @@ -20182,15 +20292,15 @@ module.exports = function () { /***/ }), -/***/ 8250: +/***/ 4052: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Blob, File } = __nccwpck_require__(4573) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) // TODO(@KhafraDev): remove class FileLike { @@ -20316,17 +20426,17 @@ module.exports = { FileLike, isFileLike } /***/ }), -/***/ 6052: +/***/ 5670: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { utf8DecodeBytes } = __nccwpck_require__(9808) -const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(8828) -const { isFileLike } = __nccwpck_require__(8250) -const { makeEntry } = __nccwpck_require__(2198) +const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { utf8DecodeBytes } = __nccwpck_require__(9614) +const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(4622) +const { isFileLike } = __nccwpck_require__(4052) +const { makeEntry } = __nccwpck_require__(7064) const assert = __nccwpck_require__(4589) const { File: NodeFile } = __nccwpck_require__(4573) @@ -20798,17 +20908,17 @@ module.exports = { /***/ }), -/***/ 2198: +/***/ 7064: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isBlobLike, iteratorMixin } = __nccwpck_require__(9808) -const { kState } = __nccwpck_require__(2043) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { FileLike, isFileLike } = __nccwpck_require__(8250) -const { webidl } = __nccwpck_require__(613) +const { isBlobLike, iteratorMixin } = __nccwpck_require__(9614) +const { kState } = __nccwpck_require__(4701) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { FileLike, isFileLike } = __nccwpck_require__(4052) +const { webidl } = __nccwpck_require__(4195) const { File: NativeFile } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) @@ -21058,7 +21168,7 @@ module.exports = { FormData, makeEntry } /***/ }), -/***/ 5699: +/***/ 7573: /***/ ((module) => { "use strict"; @@ -21106,7 +21216,7 @@ module.exports = { /***/ }), -/***/ 6548: +/***/ 4478: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -21114,14 +21224,14 @@ module.exports = { -const { kConstruct } = __nccwpck_require__(1675) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(8705) +const { kEnumerableProperty } = __nccwpck_require__(2250) const { iteratorMixin, isValidHeaderName, isValidHeaderValue -} = __nccwpck_require__(9808) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { webidl } = __nccwpck_require__(4195) const assert = __nccwpck_require__(4589) const util = __nccwpck_require__(7975) @@ -21801,7 +21911,7 @@ module.exports = { /***/ }), -/***/ 782: +/***/ 5404: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -21815,9 +21925,9 @@ const { filterResponse, makeResponse, fromInnerResponse -} = __nccwpck_require__(2603) -const { HeadersList } = __nccwpck_require__(6548) -const { Request, cloneRequest } = __nccwpck_require__(6607) +} = __nccwpck_require__(5093) +const { HeadersList } = __nccwpck_require__(4478) +const { Request, cloneRequest } = __nccwpck_require__(2257) const zlib = __nccwpck_require__(8522) const { bytesMatch, @@ -21853,23 +21963,23 @@ const { buildContentRange, createInflate, extractMimeType -} = __nccwpck_require__(9808) -const { kState, kDispatcher } = __nccwpck_require__(2043) +} = __nccwpck_require__(9614) +const { kState, kDispatcher } = __nccwpck_require__(4701) const assert = __nccwpck_require__(4589) -const { safelyExtractBody, extractBody } = __nccwpck_require__(220) +const { safelyExtractBody, extractBody } = __nccwpck_require__(3682) const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const EE = __nccwpck_require__(8474) const { Readable, pipeline, finished } = __nccwpck_require__(7075) -const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(8828) -const { getGlobalDispatcher } = __nccwpck_require__(197) -const { webidl } = __nccwpck_require__(613) +const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(4622) +const { getGlobalDispatcher } = __nccwpck_require__(6759) +const { webidl } = __nccwpck_require__(4195) const { STATUS_CODES } = __nccwpck_require__(7067) const GET_OR_HEAD = ['GET', 'HEAD'] @@ -24081,7 +24191,7 @@ module.exports = { /***/ }), -/***/ 6607: +/***/ 2257: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -24089,16 +24199,16 @@ module.exports = { -const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(220) -const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(6548) -const { FinalizationRegistry } = __nccwpck_require__(125)() -const util = __nccwpck_require__(3792) +const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(3682) +const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(4478) +const { FinalizationRegistry } = __nccwpck_require__(3207)() +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { isValidHTTPToken, sameOrigin, environmentSettingsObject -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { forbiddenMethodsSet, corsSafeListedMethodsSet, @@ -24108,12 +24218,12 @@ const { requestCredentials, requestCache, requestDuplex -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util -const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474) @@ -25126,15 +25236,15 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest } /***/ }), -/***/ 2603: +/***/ 5093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(6548) -const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(220) -const util = __nccwpck_require__(3792) +const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(4478) +const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(3682) +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { kEnumerableProperty } = util const { @@ -25146,16 +25256,16 @@ const { isErrorLike, isomorphicEncode, environmentSettingsObject: relevantRealm -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { redirectStatusSet, nullBodyStatus -} = __nccwpck_require__(1935) -const { kState, kHeaders } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { FormData } = __nccwpck_require__(2198) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +} = __nccwpck_require__(3169) +const { kState, kHeaders } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { FormData } = __nccwpck_require__(7064) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { types } = __nccwpck_require__(7975) @@ -25744,7 +25854,7 @@ module.exports = { /***/ }), -/***/ 2043: +/***/ 4701: /***/ ((module) => { "use strict"; @@ -25761,7 +25871,7 @@ module.exports = { /***/ }), -/***/ 9808: +/***/ 9614: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -25769,14 +25879,14 @@ module.exports = { const { Transform } = __nccwpck_require__(7075) const zlib = __nccwpck_require__(8522) -const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1935) -const { getGlobalOrigin } = __nccwpck_require__(5699) -const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(8828) +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(3169) +const { getGlobalOrigin } = __nccwpck_require__(7573) +const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(4622) const { performance } = __nccwpck_require__(643) -const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3792) +const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(2250) const assert = __nccwpck_require__(4589) const { isUint8Array } = __nccwpck_require__(3429) -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) let supportedHashes = [] @@ -27401,7 +27511,7 @@ module.exports = { /***/ }), -/***/ 613: +/***/ 4195: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -27409,7 +27519,7 @@ module.exports = { const { types, inspect } = __nccwpck_require__(7975) const { markAsUncloneable } = __nccwpck_require__(5919) -const { toUSVString } = __nccwpck_require__(3792) +const { toUSVString } = __nccwpck_require__(2250) /** @type {import('../../../types/webidl').Webidl} */ const webidl = {} @@ -28104,7 +28214,7 @@ module.exports = { /***/ }), -/***/ 9919: +/***/ 7261: /***/ ((module) => { "use strict"; @@ -28402,7 +28512,7 @@ module.exports = { /***/ }), -/***/ 9395: +/***/ 6705: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -28412,16 +28522,16 @@ const { staticPropertyDescriptors, readOperation, fireAProgressEvent -} = __nccwpck_require__(3738) +} = __nccwpck_require__(6532) const { kState, kError, kResult, kEvents, kAborted -} = __nccwpck_require__(2913) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +} = __nccwpck_require__(9671) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class FileReader extends EventTarget { constructor () { @@ -28754,13 +28864,13 @@ module.exports = { /***/ }), -/***/ 7101: +/***/ 8731: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) const kState = Symbol('ProgressEvent state') @@ -28840,7 +28950,7 @@ module.exports = { /***/ }), -/***/ 2913: +/***/ 9671: /***/ ((module) => { "use strict"; @@ -28858,7 +28968,7 @@ module.exports = { /***/ }), -/***/ 3738: +/***/ 6532: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -28870,10 +28980,10 @@ const { kResult, kAborted, kLastProgressEventFired -} = __nccwpck_require__(2913) -const { ProgressEvent } = __nccwpck_require__(7101) -const { getEncoding } = __nccwpck_require__(9919) -const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(8828) +} = __nccwpck_require__(9671) +const { ProgressEvent } = __nccwpck_require__(8731) +const { getEncoding } = __nccwpck_require__(7261) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4622) const { types } = __nccwpck_require__(7975) const { StringDecoder } = __nccwpck_require__(3193) const { btoa } = __nccwpck_require__(4573) @@ -29257,28 +29367,28 @@ module.exports = { /***/ }), -/***/ 737: +/***/ 2379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(2512) +const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(362) const { kReadyState, kSentClose, kByteParser, kReceivedClose, kResponse -} = __nccwpck_require__(9360) -const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(4081) -const { channels } = __nccwpck_require__(7822) -const { CloseEvent } = __nccwpck_require__(8916) -const { makeRequest } = __nccwpck_require__(6607) -const { fetching } = __nccwpck_require__(782) -const { Headers, getHeadersList } = __nccwpck_require__(6548) -const { getDecodeSplit } = __nccwpck_require__(9808) -const { WebsocketFrameSend } = __nccwpck_require__(2928) +} = __nccwpck_require__(6858) +const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(343) +const { channels } = __nccwpck_require__(6692) +const { CloseEvent } = __nccwpck_require__(4926) +const { makeRequest } = __nccwpck_require__(2257) +const { fetching } = __nccwpck_require__(5404) +const { Headers, getHeadersList } = __nccwpck_require__(4478) +const { getDecodeSplit } = __nccwpck_require__(9614) +const { WebsocketFrameSend } = __nccwpck_require__(9506) /** @type {import('crypto')} */ let crypto @@ -29636,7 +29746,7 @@ module.exports = { /***/ }), -/***/ 2512: +/***/ 362: /***/ ((module) => { "use strict"; @@ -29710,15 +29820,15 @@ module.exports = { /***/ }), -/***/ 8916: +/***/ 4926: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { kConstruct } = __nccwpck_require__(1675) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { kConstruct } = __nccwpck_require__(8705) const { MessagePort } = __nccwpck_require__(5919) /** @@ -30047,13 +30157,13 @@ module.exports = { /***/ }), -/***/ 2928: +/***/ 9506: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxUnsigned16Bit } = __nccwpck_require__(2512) +const { maxUnsigned16Bit } = __nccwpck_require__(362) const BUFFER_SIZE = 16386 @@ -30151,15 +30261,15 @@ module.exports = { /***/ }), -/***/ 477: +/***/ 1087: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522) -const { isValidClientWindowBits } = __nccwpck_require__(4081) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +const { isValidClientWindowBits } = __nccwpck_require__(343) +const { MessageSizeExceededError } = __nccwpck_require__(7617) const tail = Buffer.from([0x00, 0x00, 0xff, 0xff]) const kBuffer = Symbol('kBuffer') @@ -30259,7 +30369,7 @@ module.exports = { PerMessageDeflate } /***/ }), -/***/ 148: +/***/ 4658: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -30267,9 +30377,9 @@ module.exports = { PerMessageDeflate } const { Writable } = __nccwpck_require__(7075) const assert = __nccwpck_require__(4589) -const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(2512) -const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(9360) -const { channels } = __nccwpck_require__(7822) +const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(362) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(6858) +const { channels } = __nccwpck_require__(6692) const { isValidStatusCode, isValidOpcode, @@ -30279,11 +30389,16 @@ const { isControlFrame, isTextBinaryFrame, isContinuationFrame -} = __nccwpck_require__(4081) -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { closeWebSocketConnection } = __nccwpck_require__(737) -const { PerMessageDeflate } = __nccwpck_require__(477) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +} = __nccwpck_require__(343) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { closeWebSocketConnection } = __nccwpck_require__(2379) +const { PerMessageDeflate } = __nccwpck_require__(1087) +const { MessageSizeExceededError } = __nccwpck_require__(7617) + +function failWebsocketConnectionWithCode (ws, code, reason) { + closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason)) + failWebsocketConnection(ws, reason) +} // This code was influenced by ws released under the MIT license. // Copyright (c) 2011 Einar Otto Stangvik @@ -30304,19 +30419,23 @@ class ByteParser extends Writable { /** @type {Map} */ #extensions + /** @type {number} */ + #maxFragments + /** @type {number} */ #maxPayloadSize /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions - * @param {{ maxPayloadSize?: number }} [options] + * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options] */ constructor (ws, extensions, options = {}) { super() this.ws = ws this.#extensions = extensions == null ? new Map() : extensions + this.#maxFragments = options.maxFragments ?? 0 this.#maxPayloadSize = options.maxPayloadSize ?? 0 if (this.#extensions.has('permessage-deflate')) { @@ -30340,9 +30459,9 @@ class ByteParser extends Writable { if ( this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && - this.#info.payloadLength > this.#maxPayloadSize + this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize ) { - failWebsocketConnection(this.ws, 'Payload size exceeds maximum allowed size') + failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size') return false } @@ -30507,10 +30626,12 @@ class ByteParser extends Writable { this.#state = parserStates.INFO } else { if (!this.#info.compressed) { - this.writeFragments(body) + if (!this.writeFragments(body)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -30529,14 +30650,17 @@ class ByteParser extends Writable { this.#info.fin, (error, data) => { if (error) { - failWebsocketConnection(this.ws, error.message) + const code = error instanceof MessageSizeExceededError ? 1009 : 1007 + failWebsocketConnectionWithCode(this.ws, code, error.message) return } - this.writeFragments(data) + if (!this.writeFragments(data)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -30606,8 +30730,17 @@ class ByteParser extends Writable { } writeFragments (fragment) { + if ( + this.#maxFragments > 0 && + this.#fragments.length === this.#maxFragments + ) { + failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments') + return false + } + this.#fragmentsBytes += fragment.length this.#fragments.push(fragment) + return true } consumeFragments () { @@ -30757,15 +30890,15 @@ module.exports = { /***/ }), -/***/ 5164: +/***/ 7526: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { opcodes, sendHints } = __nccwpck_require__(2512) -const FixedQueue = __nccwpck_require__(8692) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { opcodes, sendHints } = __nccwpck_require__(362) +const FixedQueue = __nccwpck_require__(894) /** @type {typeof Uint8Array} */ const FastBuffer = Buffer[Symbol.species] @@ -30869,7 +31002,7 @@ module.exports = { SendQueue } /***/ }), -/***/ 9360: +/***/ 6858: /***/ ((module) => { "use strict"; @@ -30889,17 +31022,17 @@ module.exports = { /***/ }), -/***/ 4081: +/***/ 343: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(9360) -const { states, opcodes } = __nccwpck_require__(2512) -const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(8916) +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(6858) +const { states, opcodes } = __nccwpck_require__(362) +const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(4926) const { isUtf8 } = __nccwpck_require__(4573) -const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(8828) +const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(4622) /* globals Blob */ @@ -31219,16 +31352,16 @@ module.exports = { /***/ }), -/***/ 5134: +/***/ 9480: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { environmentSettingsObject } = __nccwpck_require__(9808) -const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(2512) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { environmentSettingsObject } = __nccwpck_require__(9614) +const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(362) const { kWebSocketURL, kReadyState, @@ -31237,21 +31370,21 @@ const { kResponse, kSentClose, kByteParser -} = __nccwpck_require__(9360) +} = __nccwpck_require__(6858) const { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent -} = __nccwpck_require__(4081) -const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(737) -const { ByteParser } = __nccwpck_require__(148) -const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3792) -const { getGlobalDispatcher } = __nccwpck_require__(197) +} = __nccwpck_require__(343) +const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(2379) +const { ByteParser } = __nccwpck_require__(4658) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(2250) +const { getGlobalDispatcher } = __nccwpck_require__(6759) const { types } = __nccwpck_require__(7975) -const { ErrorEvent, CloseEvent } = __nccwpck_require__(8916) -const { SendQueue } = __nccwpck_require__(5164) +const { ErrorEvent, CloseEvent } = __nccwpck_require__(4926) +const { SendQueue } = __nccwpck_require__(7526) // https://websockets.spec.whatwg.org/#interface-definition class WebSocket extends EventTarget { @@ -31660,9 +31793,12 @@ class WebSocket extends EventTarget { // once this happens, the connection is open this[kResponse] = response - const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize + const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions + const maxFragments = webSocketOptions?.maxFragments + const maxPayloadSize = webSocketOptions?.maxPayloadSize const parser = new ByteParser(this, parsedExtensions, { + maxFragments, maxPayloadSize }) parser.on('drain', onParserDrain) @@ -32341,13 +32477,13 @@ exports.range = range; /***/ }), -/***/ 8797: +/***/ 5994: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EXPANSION_MAX = void 0; +exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0; exports.expand = expand; const balanced_match_1 = __nccwpck_require__(5192); const escSlash = '\0SLASH' + Math.random() + '\0'; @@ -32366,6 +32502,17 @@ const closePattern = /\\}/g; const commaPattern = /\\,/g; const periodPattern = /\\\./g; exports.EXPANSION_MAX = 100_000; +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +exports.EXPANSION_MAX_LENGTH = 4_000_000; function numeric(str) { return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); } @@ -32415,7 +32562,7 @@ function expand(str, options = {}) { if (!str) { return []; } - const { max = exports.EXPANSION_MAX } = options; + const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, @@ -32425,7 +32572,7 @@ function expand(str, options = {}) { if (str.slice(0, 2) === '{}') { str = '\\{\\}' + str.slice(2); } - return expand_(escapeBraces(str), max, true).map(unescapeBraces); + return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); } function embrace(str) { return '{' + str + '}'; @@ -32439,22 +32586,117 @@ function lte(i, y) { function gte(i, y) { return i >= y; } -function expand_(str, max, isTop) { - /** @type {string[]} */ - const expansions = []; - const m = (0, balanced_match_1.balanced)('{', '}', str); - if (!m) - return [str]; - // no need to expand pre, since it is guaranteed to be free of brace-sets - const pre = m.pre; - const post = m.post.length ? expand_(m.post, max, false) : ['']; - if (/\$$/.test(m.pre)) { - for (let k = 0; k < post.length && k < max; k++) { - const expansion = pre + '{' + m.body + '}' + post[k]; - expansions.push(expansion); +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +function combine(acc, pre, values, max, maxLength, dropEmpties) { + const out = []; + let length = 0; + for (let a = 0; a < acc.length; a++) { + for (let v = 0; v < values.length; v++) { + if (out.length >= max) + return out; + const expansion = acc[a] + pre + values[v]; + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. + if (dropEmpties && !expansion) + continue; + if (length + expansion.length > maxLength) + return out; + out.push(expansion); + length += expansion.length; } } - else { + return out; +} +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence(body, isAlphaSequence, max, maxLength) { + const n = body.split(/\.\./); + const N = []; + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N; + } + /* c8 ignore stop */ + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + let length = 0; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + if (length + c.length > maxLength) + break; + N.push(c); + length += c.length; + } + return N; +} +function expand_(str, max, maxLength, isTop) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + let acc = ['']; + // Bash drops empty results, but only when the *first* top-level group is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + let dropEmpties = false; + let firstGroup = true; + for (;;) { + const m = (0, balanced_match_1.balanced)('{', '}', str); + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, str, [''], max, maxLength, dropEmpties); + } + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + if (/\$$/.test(pre)) { + acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length); + firstGroup = false; + if (!m.post.length) + break; + str = m.post; + continue; + } const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); const isSequence = isNumericSequence || isAlphaSequence; @@ -32463,87 +32705,69 @@ function expand_(str, max, isTop) { // {a},b} if (m.post.match(/,(?!,).*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; - return expand_(str, max, true); + isTop = true; + continue; } - return [str]; + // Nothing here expands, so the whole remaining string is literal. + return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties); } - let n; + if (firstGroup) { + dropEmpties = isTop && !isSequence; + firstGroup = false; + } + let values; if (isSequence) { - n = m.body.split(/\.\./); + values = expandSequence(m.body, isAlphaSequence, max, maxLength); } else { - n = parseCommaParts(m.body); + let n = parseCommaParts(m.body); if (n.length === 1 && n[0] !== undefined) { // x{{a,b}}y ==> x{a}y x{b}y - n = expand_(n[0], max, false).map(embrace); + n = expand_(n[0], max, maxLength, false).map(embrace); //XXX is this necessary? Can't seem to hit it in tests. /* c8 ignore start */ if (n.length === 1) { - return post.map(p => m.pre + n[0] + p); + acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + continue; } /* c8 ignore stop */ } - } - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - let N; - if (isSequence && n[0] !== undefined && n[1] !== undefined) { - const x = numeric(n[0]); - const y = numeric(n[1]); - const width = Math.max(n[0].length, n[1].length); - let incr = n.length === 3 && n[2] !== undefined ? - Math.max(Math.abs(numeric(n[2])), 1) - : 1; - let test = lte; - const reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - const pad = n.some(isPadded); - N = []; - for (let i = x; test(i, y) && N.length < max; i += incr) { - let c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') { - c = ''; - } - } - else { - c = String(i); - if (pad) { - const need = width - c.length; - if (need > 0) { - const z = new Array(need + 1).join('0'); - if (i < 0) { - c = '-' + z + c.slice(1); - } - else { - c = z + c; - } - } - } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; } - N.push(c); - } - } - else { - N = []; - for (let j = 0; j < n.length; j++) { - N.push.apply(N, expand_(n[j], max, false)); } - } - for (let j = 0; j < N.length; j++) { - for (let k = 0; k < post.length && expansions.length < max; k++) { - const expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) { - expansions.push(expansion); + values = []; + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; } } } + acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; } - return expansions; + return acc; } //# sourceMappingURL=index.js.map @@ -33801,7 +34025,7 @@ exports.escape = escape; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; -const brace_expansion_1 = __nccwpck_require__(8797); +const brace_expansion_1 = __nccwpck_require__(5994); const assert_valid_pattern_js_1 = __nccwpck_require__(2012); const ast_js_1 = __nccwpck_require__(5492); const escape_js_1 = __nccwpck_require__(6917); diff --git a/verify-version-change/dist/index.js b/verify-version-change/dist/index.js index ce706c9..bdc3c4f 100644 --- a/verify-version-change/dist/index.js +++ b/verify-version-change/dist/index.js @@ -2398,7 +2398,7 @@ exports.getProxyAgentDispatcher = getProxyAgentDispatcher; exports.getProxyFetch = getProxyFetch; exports.getApiBaseUrl = getApiBaseUrl; const httpClient = __importStar(__nccwpck_require__(5270)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); function getAuthString(token, options) { if (!token && !options.auth) { throw new Error('Parameter token or opts.auth is required'); @@ -2650,7 +2650,7 @@ const http = __importStar(__nccwpck_require__(8611)); const https = __importStar(__nccwpck_require__(5692)); const pm = __importStar(__nccwpck_require__(9154)); const tunnel = __importStar(__nccwpck_require__(2695)); -const undici_1 = __nccwpck_require__(9280); +const undici_1 = __nccwpck_require__(4782); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -3989,7 +3989,7 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 4424: +/***/ 2043: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -4364,7 +4364,7 @@ const LRU = __nccwpck_require__(5535) const cache = new LRU() const parseOptions = __nccwpck_require__(9100) -const Comparator = __nccwpck_require__(4424) +const Comparator = __nccwpck_require__(2043) const debug = __nccwpck_require__(63) const SemVer = __nccwpck_require__(8275) const { @@ -5661,7 +5661,7 @@ const lte = __nccwpck_require__(4373) const cmp = __nccwpck_require__(8862) const coerce = __nccwpck_require__(6017) const truncate = __nccwpck_require__(4362) -const Comparator = __nccwpck_require__(4424) +const Comparator = __nccwpck_require__(2043) const Range = __nccwpck_require__(9542) const satisfies = __nccwpck_require__(3763) const toComparators = __nccwpck_require__(7222) @@ -6326,7 +6326,7 @@ module.exports = minVersion const SemVer = __nccwpck_require__(8275) -const Comparator = __nccwpck_require__(4424) +const Comparator = __nccwpck_require__(2043) const { ANY } = Comparator const Range = __nccwpck_require__(9542) const satisfies = __nccwpck_require__(3763) @@ -6473,7 +6473,7 @@ module.exports = (versions, range, options) => { const Range = __nccwpck_require__(9542) -const Comparator = __nccwpck_require__(4424) +const Comparator = __nccwpck_require__(2043) const { ANY } = Comparator const satisfies = __nccwpck_require__(3763) const compare = __nccwpck_require__(6685) @@ -7042,34 +7042,34 @@ exports.debug = debug; // for test /***/ }), -/***/ 9280: +/***/ 4782: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Client = __nccwpck_require__(5621) -const Dispatcher = __nccwpck_require__(6307) -const Pool = __nccwpck_require__(1748) -const BalancedPool = __nccwpck_require__(9717) -const Agent = __nccwpck_require__(8717) -const ProxyAgent = __nccwpck_require__(4800) -const EnvHttpProxyAgent = __nccwpck_require__(6753) -const RetryAgent = __nccwpck_require__(6770) -const errors = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +const Client = __nccwpck_require__(8223) +const Dispatcher = __nccwpck_require__(5353) +const Pool = __nccwpck_require__(5326) +const BalancedPool = __nccwpck_require__(9159) +const Agent = __nccwpck_require__(1891) +const ProxyAgent = __nccwpck_require__(5678) +const EnvHttpProxyAgent = __nccwpck_require__(7227) +const RetryAgent = __nccwpck_require__(8792) +const errors = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { InvalidArgumentError } = errors -const api = __nccwpck_require__(9719) -const buildConnector = __nccwpck_require__(6768) -const MockClient = __nccwpck_require__(4997) -const MockAgent = __nccwpck_require__(8269) -const MockPool = __nccwpck_require__(1828) -const mockErrors = __nccwpck_require__(93) -const RetryHandler = __nccwpck_require__(2728) -const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(197) -const DecoratorHandler = __nccwpck_require__(2587) -const RedirectHandler = __nccwpck_require__(5458) -const createRedirectInterceptor = __nccwpck_require__(7780) +const api = __nccwpck_require__(497) +const buildConnector = __nccwpck_require__(5634) +const MockClient = __nccwpck_require__(3735) +const MockAgent = __nccwpck_require__(3627) +const MockPool = __nccwpck_require__(6134) +const mockErrors = __nccwpck_require__(9539) +const RetryHandler = __nccwpck_require__(8022) +const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(6759) +const DecoratorHandler = __nccwpck_require__(3253) +const RedirectHandler = __nccwpck_require__(9104) +const createRedirectInterceptor = __nccwpck_require__(5914) Object.assign(Dispatcher.prototype, api) @@ -7087,10 +7087,10 @@ module.exports.DecoratorHandler = DecoratorHandler module.exports.RedirectHandler = RedirectHandler module.exports.createRedirectInterceptor = createRedirectInterceptor module.exports.interceptors = { - redirect: __nccwpck_require__(7594), - retry: __nccwpck_require__(9722), - dump: __nccwpck_require__(4972), - dns: __nccwpck_require__(4411) + redirect: __nccwpck_require__(2524), + retry: __nccwpck_require__(2644), + dump: __nccwpck_require__(6141), + dns: __nccwpck_require__(9765) } module.exports.buildConnector = buildConnector @@ -7152,7 +7152,7 @@ function makeDispatcher (fn) { module.exports.setGlobalDispatcher = setGlobalDispatcher module.exports.getGlobalDispatcher = getGlobalDispatcher -const fetchImpl = (__nccwpck_require__(782).fetch) +const fetchImpl = (__nccwpck_require__(5404).fetch) module.exports.fetch = async function fetch (init, options = undefined) { try { return await fetchImpl(init, options) @@ -7164,39 +7164,39 @@ module.exports.fetch = async function fetch (init, options = undefined) { throw err } } -module.exports.Headers = __nccwpck_require__(6548).Headers -module.exports.Response = __nccwpck_require__(2603).Response -module.exports.Request = __nccwpck_require__(6607).Request -module.exports.FormData = __nccwpck_require__(2198).FormData +module.exports.Headers = __nccwpck_require__(4478).Headers +module.exports.Response = __nccwpck_require__(5093).Response +module.exports.Request = __nccwpck_require__(2257).Request +module.exports.FormData = __nccwpck_require__(7064).FormData module.exports.File = globalThis.File ?? (__nccwpck_require__(4573).File) -module.exports.FileReader = __nccwpck_require__(9395).FileReader +module.exports.FileReader = __nccwpck_require__(6705).FileReader -const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(5699) +const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(7573) module.exports.setGlobalOrigin = setGlobalOrigin module.exports.getGlobalOrigin = getGlobalOrigin -const { CacheStorage } = __nccwpck_require__(8733) -const { kConstruct } = __nccwpck_require__(2045) +const { CacheStorage } = __nccwpck_require__(2363) +const { kConstruct } = __nccwpck_require__(4527) // Cache & CacheStorage are tightly coupled with fetch. Even if it may run // in an older version of Node, it doesn't have any use without fetch. module.exports.caches = new CacheStorage(kConstruct) -const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1973) +const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(6783) module.exports.deleteCookie = deleteCookie module.exports.getCookies = getCookies module.exports.getSetCookies = getSetCookies module.exports.setCookie = setCookie -const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(8828) +const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4622) module.exports.parseMIMEType = parseMIMEType module.exports.serializeAMimeType = serializeAMimeType -const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(8916) -module.exports.WebSocket = __nccwpck_require__(5134).WebSocket +const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(4926) +module.exports.WebSocket = __nccwpck_require__(9480).WebSocket module.exports.CloseEvent = CloseEvent module.exports.ErrorEvent = ErrorEvent module.exports.MessageEvent = MessageEvent @@ -7212,18 +7212,18 @@ module.exports.MockPool = MockPool module.exports.MockAgent = MockAgent module.exports.mockErrors = mockErrors -const { EventSource } = __nccwpck_require__(4886) +const { EventSource } = __nccwpck_require__(5768) module.exports.EventSource = EventSource /***/ }), -/***/ 1006: +/***/ 6720: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { addAbortListener } = __nccwpck_require__(3792) -const { RequestAbortedError } = __nccwpck_require__(9715) +const { addAbortListener } = __nccwpck_require__(2250) +const { RequestAbortedError } = __nccwpck_require__(7617) const kListener = Symbol('kListener') const kSignal = Symbol('kSignal') @@ -7283,7 +7283,7 @@ module.exports = { /***/ }), -/***/ 2772: +/***/ 6958: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -7291,9 +7291,9 @@ module.exports = { const assert = __nccwpck_require__(4589) const { AsyncResource } = __nccwpck_require__(6698) -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class ConnectHandler extends AsyncResource { constructor (opts, callback) { @@ -7399,7 +7399,7 @@ module.exports = connect /***/ }), -/***/ 2846: +/***/ 8084: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -7414,10 +7414,10 @@ const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) const kResume = Symbol('resume') @@ -7658,17 +7658,17 @@ module.exports = pipeline /***/ }), -/***/ 8875: +/***/ 353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { Readable } = __nccwpck_require__(3159) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { Readable } = __nccwpck_require__(105) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) class RequestHandler extends AsyncResource { @@ -7880,7 +7880,7 @@ module.exports.RequestHandler = RequestHandler /***/ }), -/***/ 9560: +/***/ 7010: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -7888,11 +7888,11 @@ module.exports.RequestHandler = RequestHandler const assert = __nccwpck_require__(4589) const { finished, PassThrough } = __nccwpck_require__(7075) -const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { getResolveErrorBodyCallback } = __nccwpck_require__(343) +const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { getResolveErrorBodyCallback } = __nccwpck_require__(1337) const { AsyncResource } = __nccwpck_require__(6698) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const { addSignal, removeSignal } = __nccwpck_require__(6720) class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { @@ -8108,16 +8108,16 @@ module.exports = stream /***/ }), -/***/ 6538: +/***/ 7312: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError, SocketError } = __nccwpck_require__(9715) +const { InvalidArgumentError, SocketError } = __nccwpck_require__(7617) const { AsyncResource } = __nccwpck_require__(6698) -const util = __nccwpck_require__(3792) -const { addSignal, removeSignal } = __nccwpck_require__(1006) +const util = __nccwpck_require__(2250) +const { addSignal, removeSignal } = __nccwpck_require__(6720) const assert = __nccwpck_require__(4589) class UpgradeHandler extends AsyncResource { @@ -8224,22 +8224,22 @@ module.exports = upgrade /***/ }), -/***/ 9719: +/***/ 497: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports.request = __nccwpck_require__(8875) -module.exports.stream = __nccwpck_require__(9560) -module.exports.pipeline = __nccwpck_require__(2846) -module.exports.upgrade = __nccwpck_require__(6538) -module.exports.connect = __nccwpck_require__(2772) +module.exports.request = __nccwpck_require__(353) +module.exports.stream = __nccwpck_require__(7010) +module.exports.pipeline = __nccwpck_require__(8084) +module.exports.upgrade = __nccwpck_require__(7312) +module.exports.connect = __nccwpck_require__(6958) /***/ }), -/***/ 3159: +/***/ 105: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -8249,9 +8249,9 @@ module.exports.connect = __nccwpck_require__(2772) const assert = __nccwpck_require__(4589) const { Readable } = __nccwpck_require__(7075) -const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { ReadableStreamFrom } = __nccwpck_require__(3792) +const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { ReadableStreamFrom } = __nccwpck_require__(2250) const kConsume = Symbol('kConsume') const kReading = Symbol('kReading') @@ -8632,15 +8632,15 @@ module.exports = { Readable: BodyReadable, chunksDecode } /***/ }), -/***/ 343: +/***/ 1337: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(4589) const { ResponseStatusCodeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) -const { chunksDecode } = __nccwpck_require__(3159) +const { chunksDecode } = __nccwpck_require__(105) const CHUNK_LIMIT = 128 * 1024 async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { @@ -8732,7 +8732,7 @@ module.exports = { /***/ }), -/***/ 6768: +/***/ 5634: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -8740,9 +8740,9 @@ module.exports = { const net = __nccwpck_require__(7030) const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(9715) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(7617) +const timers = __nccwpck_require__(2841) function noop () {} @@ -8980,7 +8980,7 @@ module.exports = buildConnector /***/ }), -/***/ 2239: +/***/ 885: /***/ ((module) => { "use strict"; @@ -9106,7 +9106,7 @@ module.exports = { /***/ }), -/***/ 7822: +/***/ 6692: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -9316,7 +9316,7 @@ module.exports = { /***/ }), -/***/ 9715: +/***/ 7617: /***/ ((module) => { "use strict"; @@ -9749,7 +9749,7 @@ module.exports = { /***/ }), -/***/ 8655: +/***/ 7533: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -9758,7 +9758,7 @@ module.exports = { const { InvalidArgumentError, NotSupportedError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const assert = __nccwpck_require__(4589) const { isValidHTTPToken, @@ -9773,9 +9773,9 @@ const { validateHandler, getServerName, normalizedMethodRecords -} = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) +} = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) // Verifies that a given path is valid does not contain control chars \x00 to \x20 const invalidPathRegex = /[^\u0021-\u00ff]/ @@ -10162,7 +10162,7 @@ module.exports = Request /***/ }), -/***/ 1675: +/***/ 8705: /***/ ((module) => { module.exports = { @@ -10236,7 +10236,7 @@ module.exports = { /***/ }), -/***/ 4184: +/***/ 8174: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -10245,7 +10245,7 @@ module.exports = { const { wellknownHeaderNames, headerNameLowerCasedRecord -} = __nccwpck_require__(2239) +} = __nccwpck_require__(885) class TstNode { /** @type {any} */ @@ -10396,14 +10396,14 @@ module.exports = { /***/ }), -/***/ 3792: +/***/ 2250: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(1675) +const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(8705) const { IncomingMessage } = __nccwpck_require__(7067) const stream = __nccwpck_require__(7075) const net = __nccwpck_require__(7030) @@ -10411,9 +10411,9 @@ const { Blob } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) const { stringify } = __nccwpck_require__(1792) const { EventEmitter: EE } = __nccwpck_require__(8474) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { headerNameLowerCasedRecord } = __nccwpck_require__(2239) -const { tree } = __nccwpck_require__(4184) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { headerNameLowerCasedRecord } = __nccwpck_require__(885) +const { tree } = __nccwpck_require__(8174) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) @@ -11123,19 +11123,19 @@ module.exports = { /***/ }), -/***/ 8717: +/***/ 1891: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) -const DispatcherBase = __nccwpck_require__(9921) -const Pool = __nccwpck_require__(1748) -const Client = __nccwpck_require__(5621) -const util = __nccwpck_require__(3792) -const createRedirectInterceptor = __nccwpck_require__(7780) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) +const DispatcherBase = __nccwpck_require__(2403) +const Pool = __nccwpck_require__(5326) +const Client = __nccwpck_require__(8223) +const util = __nccwpck_require__(2250) +const createRedirectInterceptor = __nccwpck_require__(5914) const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') @@ -11153,7 +11153,6 @@ function defaultFactory (origin, opts) { class Agent extends DispatcherBase { constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { - if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } @@ -11261,7 +11260,7 @@ module.exports = Agent /***/ }), -/***/ 9717: +/***/ 9159: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -11270,7 +11269,7 @@ module.exports = Agent const { BalancedPoolMissingUpstreamError, InvalidArgumentError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { PoolBase, kClients, @@ -11278,10 +11277,10 @@ const { kAddClient, kRemoveClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Pool = __nccwpck_require__(1748) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const { parseOrigin } = __nccwpck_require__(3792) +} = __nccwpck_require__(7262) +const Pool = __nccwpck_require__(5326) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const { parseOrigin } = __nccwpck_require__(2250) const kFactory = Symbol('factory') const kOptions = Symbol('options') @@ -11478,7 +11477,7 @@ module.exports = BalancedPool /***/ }), -/***/ 2285: +/***/ 8875: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -11487,9 +11486,9 @@ module.exports = BalancedPool /* global WebAssembly */ const assert = __nccwpck_require__(4589) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const timers = __nccwpck_require__(1915) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const timers = __nccwpck_require__(2841) const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, @@ -11501,7 +11500,7 @@ const { BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -11534,22 +11533,25 @@ const { kOnError, kResume, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) -const constants = __nccwpck_require__(9368) +const constants = __nccwpck_require__(6882) const EMPTY_BUF = Buffer.alloc(0) const FastBuffer = Buffer[Symbol.species] const addListener = util.addListener const removeAllListeners = util.removeAllListeners +const kIdleSocketValidation = Symbol('kIdleSocketValidation') +const kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout') +const kSocketUsed = Symbol('kSocketUsed') let extractBody async function lazyllhttp () { - const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(798) : undefined + const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(4728) : undefined let mod try { - mod = await WebAssembly.compile(__nccwpck_require__(4682)) + mod = await WebAssembly.compile(__nccwpck_require__(5984)) } catch (e) { /* istanbul ignore next */ @@ -11557,7 +11559,7 @@ async function lazyllhttp () { // being enabled, but the occurring of this other error // * https://github.com/emscripten-core/emscripten/issues/11495 // got me to remove that check to avoid breaking Node 12. - mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(798)) + mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(4728)) } return await WebAssembly.instantiate(mod, { @@ -11763,29 +11765,71 @@ class Parser { const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr - if (ret === constants.ERROR.PAUSED_UPGRADE) { - this.onUpgrade(data.slice(offset)) - } else if (ret === constants.ERROR.PAUSED) { - this.paused = true - socket.unshift(data.slice(offset)) - } else if (ret !== constants.ERROR.OK) { - const ptr = llhttp.llhttp_get_error_reason(this.ptr) - let message = '' - /* istanbul ignore else: difficult to make a test case for */ - if (ptr) { - const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) - message = - 'Response does not match the HTTP/1.1 protocol (' + - Buffer.from(llhttp.memory.buffer, ptr, len).toString() + - ')' - } - throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)) + if (ret !== constants.ERROR.OK) { + const body = data.subarray(offset) + + if (ret === constants.ERROR.PAUSED_UPGRADE) { + this.onUpgrade(body) + } else if (ret === constants.ERROR.PAUSED) { + this.paused = true + socket.unshift(body) + } else { + throw this.createError(ret, body) + } } } catch (err) { util.destroy(socket, err) } } + finish () { + assert(currentParser === null) + assert(this.ptr != null) + assert(!this.paused) + + const { llhttp } = this + + let ret + + try { + currentParser = this + ret = llhttp.llhttp_finish(this.ptr) + } finally { + currentParser = null + } + + if (ret === constants.ERROR.OK) { + return null + } + + if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { + this.paused = true + return null + } + + return this.createError(ret, EMPTY_BUF) + } + + createError (ret, data) { + const { llhttp, contentLength, bytesRead } = this + + if (contentLength && bytesRead !== parseInt(contentLength, 10)) { + return new ResponseContentLengthMismatchError() + } + + const ptr = llhttp.llhttp_get_error_reason(this.ptr) + let message = '' + if (ptr) { + const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) + message = + 'Response does not match the HTTP/1.1 protocol (' + + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + + ')' + } + + return new HTTPParserError(message, constants.ERROR[ret], data) + } + destroy () { assert(this.ptr != null) assert(currentParser == null) @@ -11813,6 +11857,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] if (!request) { return -1 @@ -11916,6 +11965,11 @@ class Parser { return -1 } + if (client[kRunning] === 0) { + util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) + return -1 + } + const request = client[kQueue][client[kRunningIdx]] /* istanbul ignore next: difficult to make a test case for */ @@ -12089,6 +12143,7 @@ class Parser { request.onComplete(headers) client[kQueue][client[kRunningIdx]++] = null + socket[kSocketUsed] = true if (socket[kWriting]) { assert(client[kRunning] === 0) @@ -12147,6 +12202,9 @@ async function connectH1 (client, socket) { socket[kWriting] = false socket[kReset] = false socket[kBlocking] = false + socket[kIdleSocketValidation] = 0 + socket[kIdleSocketValidationTimeout] = null + socket[kSocketUsed] = false socket[kParser] = new Parser(client, socket, llhttpInstance) addListener(socket, 'error', function (err) { @@ -12157,8 +12215,11 @@ async function connectH1 (client, socket) { // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded // to the user. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so for as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + this[kError] = parserErr + this[kClient][kOnError](parserErr) + } return } @@ -12177,8 +12238,10 @@ async function connectH1 (client, socket) { const parser = this[kParser] if (parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + const parserErr = parser.finish() + if (parserErr) { + util.destroy(this, parserErr) + } return } @@ -12188,10 +12251,11 @@ async function connectH1 (client, socket) { const client = this[kClient] const parser = this[kParser] + clearIdleSocketValidation(this) + if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { - // We treat all incoming data so far as a valid response. - parser.onMessageComplete() + this[kError] = parser.finish() || this[kError] } this[kParser].destroy() @@ -12254,7 +12318,7 @@ async function connectH1 (client, socket) { return socket.destroyed }, busy (request) { - if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { + if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) { return true } @@ -12292,6 +12356,31 @@ async function connectH1 (client, socket) { } } +function clearIdleSocketValidation (socket) { + if (socket[kIdleSocketValidationTimeout]) { + clearTimeout(socket[kIdleSocketValidationTimeout]) + socket[kIdleSocketValidationTimeout] = null + } + + socket[kIdleSocketValidation] = 0 +} + +function scheduleIdleSocketValidation (client, socket) { + socket[kIdleSocketValidation] = 1 + socket[kIdleSocketValidationTimeout] = setTimeout(() => { + socket[kIdleSocketValidationTimeout] = null + socket[kIdleSocketValidation] = 2 + + if (client[kSocket] === socket && !socket.destroyed) { + client[kResume]() + } + }, 0) + socket[kIdleSocketValidationTimeout].unref?.() +} + +/** + * @param {import('./client.js')} client + */ function resumeH1 (client) { const socket = client[kSocket] @@ -12306,6 +12395,32 @@ function resumeH1 (client) { socket[kNoRef] = false } + if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) { + if (socket[kIdleSocketValidation] === 0) { + scheduleIdleSocketValidation(client, socket) + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + + if (socket[kIdleSocketValidation] === 1) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + return + } + } + + if (client[kRunning] === 0) { + socket[kParser].readMore() + if (socket.destroyed) { + return + } + } + if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE) @@ -12352,7 +12467,7 @@ function writeH1 (client, request) { if (util.isFormDataLike(body)) { if (!extractBody) { - extractBody = (__nccwpck_require__(220).extractBody) + extractBody = (__nccwpck_require__(3682).extractBody) } const [bodyStream, contentType] = extractBody(body) @@ -12399,6 +12514,7 @@ function writeH1 (client, request) { } const socket = client[kSocket] + clearIdleSocketValidation(socket) const abort = (err) => { if (request.aborted || request.completed) { @@ -12856,7 +12972,7 @@ module.exports = connectH1 /***/ }), -/***/ 4164: +/***/ 7662: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -12864,13 +12980,13 @@ module.exports = connectH1 const assert = __nccwpck_require__(4589) const { pipeline } = __nccwpck_require__(7075) -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError -} = __nccwpck_require__(9715) +} = __nccwpck_require__(7617) const { kUrl, kReset, @@ -12889,7 +13005,7 @@ const { kResume, kSize, kHTTPContext -} = __nccwpck_require__(1675) +} = __nccwpck_require__(8705) const kOpenStreams = Symbol('open streams') @@ -13248,7 +13364,7 @@ function writeH2 (client, request) { let contentLength = util.bodyLength(body) if (util.isFormDataLike(body)) { - extractBody ??= (__nccwpck_require__(220).extractBody) + extractBody ??= (__nccwpck_require__(3682).extractBody) const [bodyStream, contentType] = extractBody(body) headers['content-type'] = contentType @@ -13608,7 +13724,7 @@ module.exports = connectH2 /***/ }), -/***/ 5621: +/***/ 8223: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -13619,16 +13735,16 @@ module.exports = connectH2 const assert = __nccwpck_require__(4589) const net = __nccwpck_require__(7030) const http = __nccwpck_require__(7067) -const util = __nccwpck_require__(3792) -const { channels } = __nccwpck_require__(7822) -const Request = __nccwpck_require__(8655) -const DispatcherBase = __nccwpck_require__(9921) +const util = __nccwpck_require__(2250) +const { channels } = __nccwpck_require__(6692) +const Request = __nccwpck_require__(7533) +const DispatcherBase = __nccwpck_require__(2403) const { InvalidArgumentError, InformationalError, ClientDestroyedError -} = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) const { kUrl, kServerName, @@ -13670,9 +13786,9 @@ const { kHTTPContext, kMaxConcurrentStreams, kResume -} = __nccwpck_require__(1675) -const connectH1 = __nccwpck_require__(2285) -const connectH2 = __nccwpck_require__(4164) +} = __nccwpck_require__(8705) +const connectH1 = __nccwpck_require__(8875) +const connectH2 = __nccwpck_require__(7662) let deprecatedInterceptorWarned = false const kClosedResolve = Symbol('kClosedResolve') @@ -13979,7 +14095,7 @@ class Client extends DispatcherBase { } } -const createRedirectInterceptor = __nccwpck_require__(7780) +const createRedirectInterceptor = __nccwpck_require__(5914) function onError (client, err) { if ( @@ -14239,19 +14355,19 @@ module.exports = Client /***/ }), -/***/ 9921: +/***/ 2403: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) +const Dispatcher = __nccwpck_require__(5353) const { ClientDestroyedError, ClientClosedError, InvalidArgumentError -} = __nccwpck_require__(9715) -const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(1675) +} = __nccwpck_require__(7617) +const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(8705) const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') @@ -14271,6 +14387,7 @@ class DispatcherBase extends Dispatcher { get webSocketOptions () { return { + maxFragments: this[kWebSocketOptions].maxFragments ?? 131072, maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 } } @@ -14445,7 +14562,7 @@ module.exports = DispatcherBase /***/ }), -/***/ 6307: +/***/ 5353: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -14518,16 +14635,16 @@ module.exports = Dispatcher /***/ }), -/***/ 6753: +/***/ 7227: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(1675) -const ProxyAgent = __nccwpck_require__(4800) -const Agent = __nccwpck_require__(8717) +const DispatcherBase = __nccwpck_require__(2403) +const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(8705) +const ProxyAgent = __nccwpck_require__(5678) +const Agent = __nccwpck_require__(1891) const DEFAULT_PORTS = { 'http:': 80, @@ -14686,7 +14803,7 @@ module.exports = EnvHttpProxyAgent /***/ }), -/***/ 8692: +/***/ 894: /***/ ((module) => { "use strict"; @@ -14811,16 +14928,16 @@ module.exports = class FixedQueue { /***/ }), -/***/ 2192: +/***/ 7262: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const DispatcherBase = __nccwpck_require__(9921) -const FixedQueue = __nccwpck_require__(8692) -const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(1675) -const PoolStats = __nccwpck_require__(206) +const DispatcherBase = __nccwpck_require__(2403) +const FixedQueue = __nccwpck_require__(894) +const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(8705) +const PoolStats = __nccwpck_require__(3264) const kClients = Symbol('clients') const kNeedDrain = Symbol('needDrain') @@ -15013,10 +15130,10 @@ module.exports = { /***/ }), -/***/ 206: +/***/ 3264: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(1675) +const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(8705) const kPool = Symbol('pool') class PoolStats { @@ -15054,7 +15171,7 @@ module.exports = PoolStats /***/ }), -/***/ 1748: +/***/ 5326: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -15066,14 +15183,14 @@ const { kNeedDrain, kAddClient, kGetDispatcher -} = __nccwpck_require__(2192) -const Client = __nccwpck_require__(5621) +} = __nccwpck_require__(7262) +const Client = __nccwpck_require__(8223) const { InvalidArgumentError -} = __nccwpck_require__(9715) -const util = __nccwpck_require__(3792) -const { kUrl, kInterceptors } = __nccwpck_require__(1675) -const buildConnector = __nccwpck_require__(6768) +} = __nccwpck_require__(7617) +const util = __nccwpck_require__(2250) +const { kUrl, kInterceptors } = __nccwpck_require__(8705) +const buildConnector = __nccwpck_require__(5634) const kOptions = Symbol('options') const kConnections = Symbol('connections') @@ -15169,20 +15286,20 @@ module.exports = Pool /***/ }), -/***/ 4800: +/***/ 5678: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(1675) +const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(8705) const { URL } = __nccwpck_require__(3136) -const Agent = __nccwpck_require__(8717) -const Pool = __nccwpck_require__(1748) -const DispatcherBase = __nccwpck_require__(9921) -const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(9715) -const buildConnector = __nccwpck_require__(6768) -const Client = __nccwpck_require__(5621) +const Agent = __nccwpck_require__(1891) +const Pool = __nccwpck_require__(5326) +const DispatcherBase = __nccwpck_require__(2403) +const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(7617) +const buildConnector = __nccwpck_require__(5634) +const Client = __nccwpck_require__(8223) const kAgent = Symbol('proxy agent') const kClient = Symbol('proxy client') @@ -15451,14 +15568,14 @@ module.exports = ProxyAgent /***/ }), -/***/ 6770: +/***/ 8792: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const Dispatcher = __nccwpck_require__(6307) -const RetryHandler = __nccwpck_require__(2728) +const Dispatcher = __nccwpck_require__(5353) +const RetryHandler = __nccwpck_require__(8022) class RetryAgent extends Dispatcher { #agent = null @@ -15494,7 +15611,7 @@ module.exports = RetryAgent /***/ }), -/***/ 197: +/***/ 6759: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -15503,8 +15620,8 @@ module.exports = RetryAgent // We include a version number for the Dispatcher API. In case of breaking changes, // this version number must be increased to avoid conflicts. const globalDispatcher = Symbol.for('undici.globalDispatcher.1') -const { InvalidArgumentError } = __nccwpck_require__(9715) -const Agent = __nccwpck_require__(8717) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const Agent = __nccwpck_require__(1891) if (getGlobalDispatcher() === undefined) { setGlobalDispatcher(new Agent()) @@ -15534,7 +15651,7 @@ module.exports = { /***/ }), -/***/ 2587: +/***/ 3253: /***/ ((module) => { "use strict"; @@ -15586,16 +15703,16 @@ module.exports = class DecoratorHandler { /***/ }), -/***/ 5458: +/***/ 9104: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { kBodyUsed } = __nccwpck_require__(1675) +const util = __nccwpck_require__(2250) +const { kBodyUsed } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) -const { InvalidArgumentError } = __nccwpck_require__(9715) +const { InvalidArgumentError } = __nccwpck_require__(7617) const EE = __nccwpck_require__(8474) const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] @@ -15826,21 +15943,21 @@ module.exports = RedirectHandler /***/ }), -/***/ 2728: +/***/ 8022: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { kRetryHandlerDefaultRetry } = __nccwpck_require__(1675) -const { RequestRetryError } = __nccwpck_require__(9715) +const { kRetryHandlerDefaultRetry } = __nccwpck_require__(8705) +const { RequestRetryError } = __nccwpck_require__(7617) const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody -} = __nccwpck_require__(3792) +} = __nccwpck_require__(2250) function calculateRetryAfterHeader (retryAfter) { const current = Date.now() @@ -16208,15 +16325,15 @@ module.exports = RetryHandler /***/ }), -/***/ 4411: +/***/ 9765: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { isIP } = __nccwpck_require__(7030) const { lookup } = __nccwpck_require__(610) -const DecoratorHandler = __nccwpck_require__(2587) -const { InvalidArgumentError, InformationalError } = __nccwpck_require__(9715) +const DecoratorHandler = __nccwpck_require__(3253) +const { InvalidArgumentError, InformationalError } = __nccwpck_require__(7617) const maxInt = Math.pow(2, 31) - 1 class DNSInstance { @@ -16591,15 +16708,15 @@ module.exports = interceptorOpts => { /***/ }), -/***/ 4972: +/***/ 6141: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) -const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(9715) -const DecoratorHandler = __nccwpck_require__(2587) +const util = __nccwpck_require__(2250) +const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(7617) +const DecoratorHandler = __nccwpck_require__(3253) class DumpHandler extends DecoratorHandler { #maxSize = 1024 * 1024 @@ -16722,13 +16839,13 @@ module.exports = createDumpInterceptor /***/ }), -/***/ 7780: +/***/ 5914: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { @@ -16751,12 +16868,12 @@ module.exports = createRedirectInterceptor /***/ }), -/***/ 7594: +/***/ 2524: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RedirectHandler = __nccwpck_require__(5458) +const RedirectHandler = __nccwpck_require__(9104) module.exports = opts => { const globalMaxRedirections = opts?.maxRedirections @@ -16783,12 +16900,12 @@ module.exports = opts => { /***/ }), -/***/ 9722: +/***/ 2644: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const RetryHandler = __nccwpck_require__(2728) +const RetryHandler = __nccwpck_require__(8022) module.exports = globalOpts => { return dispatch => { @@ -16810,14 +16927,14 @@ module.exports = globalOpts => { /***/ }), -/***/ 9368: +/***/ 6882: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; -const utils_1 = __nccwpck_require__(2316); +const utils_1 = __nccwpck_require__(2234); // C headers var ERROR; (function (ERROR) { @@ -17095,7 +17212,7 @@ exports.SPECIAL_HEADERS = { /***/ }), -/***/ 798: +/***/ 4728: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -17108,7 +17225,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 4682: +/***/ 5984: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -17121,7 +17238,7 @@ module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f3 /***/ }), -/***/ 2316: +/***/ 2234: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -17143,14 +17260,14 @@ exports.enumToMap = enumToMap; /***/ }), -/***/ 8269: +/***/ 3627: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kClients } = __nccwpck_require__(1675) -const Agent = __nccwpck_require__(8717) +const { kClients } = __nccwpck_require__(8705) +const Agent = __nccwpck_require__(1891) const { kAgent, kMockAgentSet, @@ -17161,14 +17278,14 @@ const { kGetNetConnect, kOptions, kFactory -} = __nccwpck_require__(4093) -const MockClient = __nccwpck_require__(4997) -const MockPool = __nccwpck_require__(1828) -const { matchValue, buildMockOptions } = __nccwpck_require__(3589) -const { InvalidArgumentError, UndiciError } = __nccwpck_require__(9715) -const Dispatcher = __nccwpck_require__(6307) -const Pluralizer = __nccwpck_require__(5097) -const PendingInterceptorsFormatter = __nccwpck_require__(9758) +} = __nccwpck_require__(4251) +const MockClient = __nccwpck_require__(3735) +const MockPool = __nccwpck_require__(6134) +const { matchValue, buildMockOptions } = __nccwpck_require__(6031) +const { InvalidArgumentError, UndiciError } = __nccwpck_require__(7617) +const Dispatcher = __nccwpck_require__(5353) +const Pluralizer = __nccwpck_require__(1591) +const PendingInterceptorsFormatter = __nccwpck_require__(9236) class MockAgent extends Dispatcher { constructor (opts) { @@ -17311,15 +17428,15 @@ module.exports = MockAgent /***/ }), -/***/ 4997: +/***/ 3735: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Client = __nccwpck_require__(5621) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Client = __nccwpck_require__(8223) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -17328,10 +17445,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockClient provides an API that extends the Client to influence the mockDispatches. @@ -17378,13 +17495,13 @@ module.exports = MockClient /***/ }), -/***/ 93: +/***/ 9539: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { UndiciError } = __nccwpck_require__(9715) +const { UndiciError } = __nccwpck_require__(7617) const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED') @@ -17414,13 +17531,13 @@ module.exports = { /***/ }), -/***/ 6039: +/***/ 3969: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3589) +const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kDispatchKey, @@ -17428,9 +17545,9 @@ const { kDefaultTrailers, kContentLength, kMockDispatch -} = __nccwpck_require__(4093) -const { InvalidArgumentError } = __nccwpck_require__(9715) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { InvalidArgumentError } = __nccwpck_require__(7617) +const { buildURL } = __nccwpck_require__(2250) /** * Defines the scope API for an interceptor reply @@ -17629,15 +17746,15 @@ module.exports.MockScope = MockScope /***/ }), -/***/ 1828: +/***/ 6134: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(7975) -const Pool = __nccwpck_require__(1748) -const { buildMockDispatch } = __nccwpck_require__(3589) +const Pool = __nccwpck_require__(5326) +const { buildMockDispatch } = __nccwpck_require__(6031) const { kDispatches, kMockAgent, @@ -17646,10 +17763,10 @@ const { kOrigin, kOriginalDispatch, kConnected -} = __nccwpck_require__(4093) -const { MockInterceptor } = __nccwpck_require__(6039) -const Symbols = __nccwpck_require__(1675) -const { InvalidArgumentError } = __nccwpck_require__(9715) +} = __nccwpck_require__(4251) +const { MockInterceptor } = __nccwpck_require__(3969) +const Symbols = __nccwpck_require__(8705) +const { InvalidArgumentError } = __nccwpck_require__(7617) /** * MockPool provides an API that extends the Pool to influence the mockDispatches. @@ -17696,7 +17813,7 @@ module.exports = MockPool /***/ }), -/***/ 4093: +/***/ 4251: /***/ ((module) => { "use strict"; @@ -17727,21 +17844,21 @@ module.exports = { /***/ }), -/***/ 3589: +/***/ 6031: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { MockNotMatchedError } = __nccwpck_require__(93) +const { MockNotMatchedError } = __nccwpck_require__(9539) const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect -} = __nccwpck_require__(4093) -const { buildURL } = __nccwpck_require__(3792) +} = __nccwpck_require__(4251) +const { buildURL } = __nccwpck_require__(2250) const { STATUS_CODES } = __nccwpck_require__(7067) const { types: { @@ -18102,7 +18219,7 @@ module.exports = { /***/ }), -/***/ 9758: +/***/ 9236: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -18153,7 +18270,7 @@ module.exports = class PendingInterceptorsFormatter { /***/ }), -/***/ 5097: +/***/ 1591: /***/ ((module) => { "use strict"; @@ -18190,7 +18307,7 @@ module.exports = class Pluralizer { /***/ }), -/***/ 1915: +/***/ 2841: /***/ ((module) => { "use strict"; @@ -18621,21 +18738,21 @@ module.exports = { /***/ }), -/***/ 5714: +/***/ 9556: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { urlEquals, getFieldValues } = __nccwpck_require__(8094) -const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3792) -const { webidl } = __nccwpck_require__(613) -const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(2603) -const { Request, fromInnerRequest } = __nccwpck_require__(6607) -const { kState } = __nccwpck_require__(2043) -const { fetching } = __nccwpck_require__(782) -const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9808) +const { kConstruct } = __nccwpck_require__(4527) +const { urlEquals, getFieldValues } = __nccwpck_require__(7900) +const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(2250) +const { webidl } = __nccwpck_require__(4195) +const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(5093) +const { Request, fromInnerRequest } = __nccwpck_require__(2257) +const { kState } = __nccwpck_require__(4701) +const { fetching } = __nccwpck_require__(5404) +const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(9614) const assert = __nccwpck_require__(4589) /** @@ -19488,16 +19605,16 @@ module.exports = { /***/ }), -/***/ 8733: +/***/ 2363: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConstruct } = __nccwpck_require__(2045) -const { Cache } = __nccwpck_require__(5714) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(4527) +const { Cache } = __nccwpck_require__(9556) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class CacheStorage { /** @@ -19648,28 +19765,28 @@ module.exports = { /***/ }), -/***/ 2045: +/***/ 4527: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { - kConstruct: (__nccwpck_require__(1675).kConstruct) + kConstruct: (__nccwpck_require__(8705).kConstruct) } /***/ }), -/***/ 8094: +/***/ 7900: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(4589) -const { URLSerializer } = __nccwpck_require__(8828) -const { isValidHeaderName } = __nccwpck_require__(9808) +const { URLSerializer } = __nccwpck_require__(4622) +const { isValidHeaderName } = __nccwpck_require__(9614) /** * @see https://url.spec.whatwg.org/#concept-url-equals @@ -19714,7 +19831,7 @@ module.exports = { /***/ }), -/***/ 924: +/***/ 8498: /***/ ((module) => { "use strict"; @@ -19734,16 +19851,16 @@ module.exports = { /***/ }), -/***/ 1973: +/***/ 6783: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { parseSetCookie } = __nccwpck_require__(3498) -const { stringify } = __nccwpck_require__(4533) -const { webidl } = __nccwpck_require__(613) -const { Headers } = __nccwpck_require__(6548) +const { parseSetCookie } = __nccwpck_require__(9032) +const { stringify } = __nccwpck_require__(6095) +const { webidl } = __nccwpck_require__(4195) +const { Headers } = __nccwpck_require__(4478) /** * @typedef {Object} Cookie @@ -19926,15 +20043,15 @@ module.exports = { /***/ }), -/***/ 3498: +/***/ 9032: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(924) -const { isCTLExcludingHtab } = __nccwpck_require__(4533) -const { collectASequenceOfCodePointsFast } = __nccwpck_require__(8828) +const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(8498) +const { isCTLExcludingHtab } = __nccwpck_require__(6095) +const { collectASequenceOfCodePointsFast } = __nccwpck_require__(4622) const assert = __nccwpck_require__(4589) /** @@ -20207,32 +20324,25 @@ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) // If the attribute-name case-insensitively matches the string // "SameSite", the user agent MUST process the cookie-av as follows: - // 1. Let enforcement be "Default". - let enforcement = 'Default' - const attributeValueLowercase = attributeValue.toLowerCase() - // 2. If cookie-av's attribute-value is a case-insensitive match for - // "None", set enforcement to "None". - if (attributeValueLowercase.includes('none')) { - enforcement = 'None' - } - // 3. If cookie-av's attribute-value is a case-insensitive match for - // "Strict", set enforcement to "Strict". - if (attributeValueLowercase.includes('strict')) { - enforcement = 'Strict' + // 1. If cookie-av's attribute-value is a case-insensitive match for + // "None", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "None". + if (attributeValueLowercase === 'none') { + cookieAttributeList.sameSite = 'None' + } else if (attributeValueLowercase === 'strict') { + // 2. If cookie-av's attribute-value is a case-insensitive match for + // "Strict", append an attribute to the cookie-attribute-list with + // an attribute-name of "SameSite" and an attribute-value of + // "Strict". + cookieAttributeList.sameSite = 'Strict' + } else if (attributeValueLowercase === 'lax') { + // 3. If cookie-av's attribute-value is a case-insensitive match for + // "Lax", append an attribute to the cookie-attribute-list with an + // attribute-name of "SameSite" and an attribute-value of "Lax". + cookieAttributeList.sameSite = 'Lax' } - - // 4. If cookie-av's attribute-value is a case-insensitive match for - // "Lax", set enforcement to "Lax". - if (attributeValueLowercase.includes('lax')) { - enforcement = 'Lax' - } - - // 5. Append an attribute to the cookie-attribute-list with an - // attribute-name of "SameSite" and an attribute-value of - // enforcement. - cookieAttributeList.sameSite = enforcement } else { cookieAttributeList.unparsed ??= [] @@ -20251,7 +20361,7 @@ module.exports = { /***/ }), -/***/ 4533: +/***/ 6095: /***/ ((module) => { "use strict"; @@ -20541,13 +20651,13 @@ module.exports = { /***/ }), -/***/ 8735: +/***/ 1581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Transform } = __nccwpck_require__(7075) -const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(3867) +const { isASCIINumber, isValidLastEventId } = __nccwpck_require__(5537) /** * @type {number[]} BOM @@ -20947,23 +21057,23 @@ module.exports = { /***/ }), -/***/ 4886: +/***/ 5768: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { pipeline } = __nccwpck_require__(7075) -const { fetching } = __nccwpck_require__(782) -const { makeRequest } = __nccwpck_require__(6607) -const { webidl } = __nccwpck_require__(613) -const { EventSourceStream } = __nccwpck_require__(8735) -const { parseMIMEType } = __nccwpck_require__(8828) -const { createFastMessageEvent } = __nccwpck_require__(8916) -const { isNetworkError } = __nccwpck_require__(2603) -const { delay } = __nccwpck_require__(3867) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { environmentSettingsObject } = __nccwpck_require__(9808) +const { fetching } = __nccwpck_require__(5404) +const { makeRequest } = __nccwpck_require__(2257) +const { webidl } = __nccwpck_require__(4195) +const { EventSourceStream } = __nccwpck_require__(1581) +const { parseMIMEType } = __nccwpck_require__(4622) +const { createFastMessageEvent } = __nccwpck_require__(4926) +const { isNetworkError } = __nccwpck_require__(5093) +const { delay } = __nccwpck_require__(5537) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { environmentSettingsObject } = __nccwpck_require__(9614) let experimentalWarned = false @@ -21435,7 +21545,7 @@ module.exports = { /***/ }), -/***/ 3867: +/***/ 5537: /***/ ((module) => { "use strict"; @@ -21480,13 +21590,13 @@ module.exports = { /***/ }), -/***/ 220: +/***/ 3682: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const util = __nccwpck_require__(3792) +const util = __nccwpck_require__(2250) const { ReadableStreamFrom, isBlobLike, @@ -21496,16 +21606,16 @@ const { fullyReadBody, extractMimeType, utf8DecodeBytes -} = __nccwpck_require__(9808) -const { FormData } = __nccwpck_require__(2198) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { FormData } = __nccwpck_require__(7064) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) const { Blob } = __nccwpck_require__(4573) const assert = __nccwpck_require__(4589) const { isErrored, isDisturbed } = __nccwpck_require__(7075) const { isArrayBuffer } = __nccwpck_require__(3429) -const { serializeAMimeType } = __nccwpck_require__(8828) -const { multipartFormDataParser } = __nccwpck_require__(6052) +const { serializeAMimeType } = __nccwpck_require__(4622) +const { multipartFormDataParser } = __nccwpck_require__(5670) let random try { @@ -22017,7 +22127,7 @@ module.exports = { /***/ }), -/***/ 1935: +/***/ 3169: /***/ ((module) => { "use strict"; @@ -22149,7 +22259,7 @@ module.exports = { /***/ }), -/***/ 8828: +/***/ 4622: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -22901,13 +23011,13 @@ module.exports = { /***/ }), -/***/ 125: +/***/ 3207: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kConnected, kSize } = __nccwpck_require__(1675) +const { kConnected, kSize } = __nccwpck_require__(8705) class CompatWeakRef { constructor (value) { @@ -22955,15 +23065,15 @@ module.exports = function () { /***/ }), -/***/ 8250: +/***/ 4052: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Blob, File } = __nccwpck_require__(4573) -const { kState } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) +const { kState } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) // TODO(@KhafraDev): remove class FileLike { @@ -23089,17 +23199,17 @@ module.exports = { FileLike, isFileLike } /***/ }), -/***/ 6052: +/***/ 5670: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { utf8DecodeBytes } = __nccwpck_require__(9808) -const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(8828) -const { isFileLike } = __nccwpck_require__(8250) -const { makeEntry } = __nccwpck_require__(2198) +const { isUSVString, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { utf8DecodeBytes } = __nccwpck_require__(9614) +const { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = __nccwpck_require__(4622) +const { isFileLike } = __nccwpck_require__(4052) +const { makeEntry } = __nccwpck_require__(7064) const assert = __nccwpck_require__(4589) const { File: NodeFile } = __nccwpck_require__(4573) @@ -23571,17 +23681,17 @@ module.exports = { /***/ }), -/***/ 2198: +/***/ 7064: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { isBlobLike, iteratorMixin } = __nccwpck_require__(9808) -const { kState } = __nccwpck_require__(2043) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { FileLike, isFileLike } = __nccwpck_require__(8250) -const { webidl } = __nccwpck_require__(613) +const { isBlobLike, iteratorMixin } = __nccwpck_require__(9614) +const { kState } = __nccwpck_require__(4701) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { FileLike, isFileLike } = __nccwpck_require__(4052) +const { webidl } = __nccwpck_require__(4195) const { File: NativeFile } = __nccwpck_require__(4573) const nodeUtil = __nccwpck_require__(7975) @@ -23831,7 +23941,7 @@ module.exports = { FormData, makeEntry } /***/ }), -/***/ 5699: +/***/ 7573: /***/ ((module) => { "use strict"; @@ -23879,7 +23989,7 @@ module.exports = { /***/ }), -/***/ 6548: +/***/ 4478: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -23887,14 +23997,14 @@ module.exports = { -const { kConstruct } = __nccwpck_require__(1675) -const { kEnumerableProperty } = __nccwpck_require__(3792) +const { kConstruct } = __nccwpck_require__(8705) +const { kEnumerableProperty } = __nccwpck_require__(2250) const { iteratorMixin, isValidHeaderName, isValidHeaderValue -} = __nccwpck_require__(9808) -const { webidl } = __nccwpck_require__(613) +} = __nccwpck_require__(9614) +const { webidl } = __nccwpck_require__(4195) const assert = __nccwpck_require__(4589) const util = __nccwpck_require__(7975) @@ -24574,7 +24684,7 @@ module.exports = { /***/ }), -/***/ 782: +/***/ 5404: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -24588,9 +24698,9 @@ const { filterResponse, makeResponse, fromInnerResponse -} = __nccwpck_require__(2603) -const { HeadersList } = __nccwpck_require__(6548) -const { Request, cloneRequest } = __nccwpck_require__(6607) +} = __nccwpck_require__(5093) +const { HeadersList } = __nccwpck_require__(4478) +const { Request, cloneRequest } = __nccwpck_require__(2257) const zlib = __nccwpck_require__(8522) const { bytesMatch, @@ -24626,23 +24736,23 @@ const { buildContentRange, createInflate, extractMimeType -} = __nccwpck_require__(9808) -const { kState, kDispatcher } = __nccwpck_require__(2043) +} = __nccwpck_require__(9614) +const { kState, kDispatcher } = __nccwpck_require__(4701) const assert = __nccwpck_require__(4589) -const { safelyExtractBody, extractBody } = __nccwpck_require__(220) +const { safelyExtractBody, extractBody } = __nccwpck_require__(3682) const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const EE = __nccwpck_require__(8474) const { Readable, pipeline, finished } = __nccwpck_require__(7075) -const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(3792) -const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(8828) -const { getGlobalDispatcher } = __nccwpck_require__(197) -const { webidl } = __nccwpck_require__(613) +const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = __nccwpck_require__(2250) +const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = __nccwpck_require__(4622) +const { getGlobalDispatcher } = __nccwpck_require__(6759) +const { webidl } = __nccwpck_require__(4195) const { STATUS_CODES } = __nccwpck_require__(7067) const GET_OR_HEAD = ['GET', 'HEAD'] @@ -26854,7 +26964,7 @@ module.exports = { /***/ }), -/***/ 6607: +/***/ 2257: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -26862,16 +26972,16 @@ module.exports = { -const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(220) -const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(6548) -const { FinalizationRegistry } = __nccwpck_require__(125)() -const util = __nccwpck_require__(3792) +const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(3682) +const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(4478) +const { FinalizationRegistry } = __nccwpck_require__(3207)() +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { isValidHTTPToken, sameOrigin, environmentSettingsObject -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { forbiddenMethodsSet, corsSafeListedMethodsSet, @@ -26881,12 +26991,12 @@ const { requestCredentials, requestCache, requestDuplex -} = __nccwpck_require__(1935) +} = __nccwpck_require__(3169) const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util -const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +const { kHeaders, kSignal, kState, kDispatcher } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(8474) @@ -27899,15 +28009,15 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest } /***/ }), -/***/ 2603: +/***/ 5093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(6548) -const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(220) -const util = __nccwpck_require__(3792) +const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(4478) +const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(3682) +const util = __nccwpck_require__(2250) const nodeUtil = __nccwpck_require__(7975) const { kEnumerableProperty } = util const { @@ -27919,16 +28029,16 @@ const { isErrorLike, isomorphicEncode, environmentSettingsObject: relevantRealm -} = __nccwpck_require__(9808) +} = __nccwpck_require__(9614) const { redirectStatusSet, nullBodyStatus -} = __nccwpck_require__(1935) -const { kState, kHeaders } = __nccwpck_require__(2043) -const { webidl } = __nccwpck_require__(613) -const { FormData } = __nccwpck_require__(2198) -const { URLSerializer } = __nccwpck_require__(8828) -const { kConstruct } = __nccwpck_require__(1675) +} = __nccwpck_require__(3169) +const { kState, kHeaders } = __nccwpck_require__(4701) +const { webidl } = __nccwpck_require__(4195) +const { FormData } = __nccwpck_require__(7064) +const { URLSerializer } = __nccwpck_require__(4622) +const { kConstruct } = __nccwpck_require__(8705) const assert = __nccwpck_require__(4589) const { types } = __nccwpck_require__(7975) @@ -28517,7 +28627,7 @@ module.exports = { /***/ }), -/***/ 2043: +/***/ 4701: /***/ ((module) => { "use strict"; @@ -28534,7 +28644,7 @@ module.exports = { /***/ }), -/***/ 9808: +/***/ 9614: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -28542,14 +28652,14 @@ module.exports = { const { Transform } = __nccwpck_require__(7075) const zlib = __nccwpck_require__(8522) -const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1935) -const { getGlobalOrigin } = __nccwpck_require__(5699) -const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(8828) +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(3169) +const { getGlobalOrigin } = __nccwpck_require__(7573) +const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = __nccwpck_require__(4622) const { performance } = __nccwpck_require__(643) -const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(3792) +const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = __nccwpck_require__(2250) const assert = __nccwpck_require__(4589) const { isUint8Array } = __nccwpck_require__(3429) -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) let supportedHashes = [] @@ -30174,7 +30284,7 @@ module.exports = { /***/ }), -/***/ 613: +/***/ 4195: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -30182,7 +30292,7 @@ module.exports = { const { types, inspect } = __nccwpck_require__(7975) const { markAsUncloneable } = __nccwpck_require__(5919) -const { toUSVString } = __nccwpck_require__(3792) +const { toUSVString } = __nccwpck_require__(2250) /** @type {import('../../../types/webidl').Webidl} */ const webidl = {} @@ -30877,7 +30987,7 @@ module.exports = { /***/ }), -/***/ 9919: +/***/ 7261: /***/ ((module) => { "use strict"; @@ -31175,7 +31285,7 @@ module.exports = { /***/ }), -/***/ 9395: +/***/ 6705: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -31185,16 +31295,16 @@ const { staticPropertyDescriptors, readOperation, fireAProgressEvent -} = __nccwpck_require__(3738) +} = __nccwpck_require__(6532) const { kState, kError, kResult, kEvents, kAborted -} = __nccwpck_require__(2913) -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) +} = __nccwpck_require__(9671) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) class FileReader extends EventTarget { constructor () { @@ -31527,13 +31637,13 @@ module.exports = { /***/ }), -/***/ 7101: +/***/ 8731: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) +const { webidl } = __nccwpck_require__(4195) const kState = Symbol('ProgressEvent state') @@ -31613,7 +31723,7 @@ module.exports = { /***/ }), -/***/ 2913: +/***/ 9671: /***/ ((module) => { "use strict"; @@ -31631,7 +31741,7 @@ module.exports = { /***/ }), -/***/ 3738: +/***/ 6532: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -31643,10 +31753,10 @@ const { kResult, kAborted, kLastProgressEventFired -} = __nccwpck_require__(2913) -const { ProgressEvent } = __nccwpck_require__(7101) -const { getEncoding } = __nccwpck_require__(9919) -const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(8828) +} = __nccwpck_require__(9671) +const { ProgressEvent } = __nccwpck_require__(8731) +const { getEncoding } = __nccwpck_require__(7261) +const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(4622) const { types } = __nccwpck_require__(7975) const { StringDecoder } = __nccwpck_require__(3193) const { btoa } = __nccwpck_require__(4573) @@ -32030,28 +32140,28 @@ module.exports = { /***/ }), -/***/ 737: +/***/ 2379: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(2512) +const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = __nccwpck_require__(362) const { kReadyState, kSentClose, kByteParser, kReceivedClose, kResponse -} = __nccwpck_require__(9360) -const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(4081) -const { channels } = __nccwpck_require__(7822) -const { CloseEvent } = __nccwpck_require__(8916) -const { makeRequest } = __nccwpck_require__(6607) -const { fetching } = __nccwpck_require__(782) -const { Headers, getHeadersList } = __nccwpck_require__(6548) -const { getDecodeSplit } = __nccwpck_require__(9808) -const { WebsocketFrameSend } = __nccwpck_require__(2928) +} = __nccwpck_require__(6858) +const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = __nccwpck_require__(343) +const { channels } = __nccwpck_require__(6692) +const { CloseEvent } = __nccwpck_require__(4926) +const { makeRequest } = __nccwpck_require__(2257) +const { fetching } = __nccwpck_require__(5404) +const { Headers, getHeadersList } = __nccwpck_require__(4478) +const { getDecodeSplit } = __nccwpck_require__(9614) +const { WebsocketFrameSend } = __nccwpck_require__(9506) /** @type {import('crypto')} */ let crypto @@ -32409,7 +32519,7 @@ module.exports = { /***/ }), -/***/ 2512: +/***/ 362: /***/ ((module) => { "use strict"; @@ -32483,15 +32593,15 @@ module.exports = { /***/ }), -/***/ 8916: +/***/ 4926: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { kEnumerableProperty } = __nccwpck_require__(3792) -const { kConstruct } = __nccwpck_require__(1675) +const { webidl } = __nccwpck_require__(4195) +const { kEnumerableProperty } = __nccwpck_require__(2250) +const { kConstruct } = __nccwpck_require__(8705) const { MessagePort } = __nccwpck_require__(5919) /** @@ -32820,13 +32930,13 @@ module.exports = { /***/ }), -/***/ 2928: +/***/ 9506: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { maxUnsigned16Bit } = __nccwpck_require__(2512) +const { maxUnsigned16Bit } = __nccwpck_require__(362) const BUFFER_SIZE = 16386 @@ -32924,15 +33034,15 @@ module.exports = { /***/ }), -/***/ 477: +/***/ 1087: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = __nccwpck_require__(8522) -const { isValidClientWindowBits } = __nccwpck_require__(4081) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +const { isValidClientWindowBits } = __nccwpck_require__(343) +const { MessageSizeExceededError } = __nccwpck_require__(7617) const tail = Buffer.from([0x00, 0x00, 0xff, 0xff]) const kBuffer = Symbol('kBuffer') @@ -33032,7 +33142,7 @@ module.exports = { PerMessageDeflate } /***/ }), -/***/ 148: +/***/ 4658: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; @@ -33040,9 +33150,9 @@ module.exports = { PerMessageDeflate } const { Writable } = __nccwpck_require__(7075) const assert = __nccwpck_require__(4589) -const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(2512) -const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(9360) -const { channels } = __nccwpck_require__(7822) +const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = __nccwpck_require__(362) +const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(6858) +const { channels } = __nccwpck_require__(6692) const { isValidStatusCode, isValidOpcode, @@ -33052,11 +33162,16 @@ const { isControlFrame, isTextBinaryFrame, isContinuationFrame -} = __nccwpck_require__(4081) -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { closeWebSocketConnection } = __nccwpck_require__(737) -const { PerMessageDeflate } = __nccwpck_require__(477) -const { MessageSizeExceededError } = __nccwpck_require__(9715) +} = __nccwpck_require__(343) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { closeWebSocketConnection } = __nccwpck_require__(2379) +const { PerMessageDeflate } = __nccwpck_require__(1087) +const { MessageSizeExceededError } = __nccwpck_require__(7617) + +function failWebsocketConnectionWithCode (ws, code, reason) { + closeWebSocketConnection(ws, code, reason, Buffer.byteLength(reason)) + failWebsocketConnection(ws, reason) +} // This code was influenced by ws released under the MIT license. // Copyright (c) 2011 Einar Otto Stangvik @@ -33077,19 +33192,23 @@ class ByteParser extends Writable { /** @type {Map} */ #extensions + /** @type {number} */ + #maxFragments + /** @type {number} */ #maxPayloadSize /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions - * @param {{ maxPayloadSize?: number }} [options] + * @param {{ maxFragments?: number, maxPayloadSize?: number }} [options] */ constructor (ws, extensions, options = {}) { super() this.ws = ws this.#extensions = extensions == null ? new Map() : extensions + this.#maxFragments = options.maxFragments ?? 0 this.#maxPayloadSize = options.maxPayloadSize ?? 0 if (this.#extensions.has('permessage-deflate')) { @@ -33113,9 +33232,9 @@ class ByteParser extends Writable { if ( this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && - this.#info.payloadLength > this.#maxPayloadSize + this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize ) { - failWebsocketConnection(this.ws, 'Payload size exceeds maximum allowed size') + failWebsocketConnectionWithCode(this.ws, 1009, 'Payload size exceeds maximum allowed size') return false } @@ -33280,10 +33399,12 @@ class ByteParser extends Writable { this.#state = parserStates.INFO } else { if (!this.#info.compressed) { - this.writeFragments(body) + if (!this.writeFragments(body)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -33302,14 +33423,17 @@ class ByteParser extends Writable { this.#info.fin, (error, data) => { if (error) { - failWebsocketConnection(this.ws, error.message) + const code = error instanceof MessageSizeExceededError ? 1009 : 1007 + failWebsocketConnectionWithCode(this.ws, code, error.message) return } - this.writeFragments(data) + if (!this.writeFragments(data)) { + return + } if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { - failWebsocketConnection(this.ws, new MessageSizeExceededError().message) + failWebsocketConnectionWithCode(this.ws, 1009, new MessageSizeExceededError().message) return } @@ -33379,8 +33503,17 @@ class ByteParser extends Writable { } writeFragments (fragment) { + if ( + this.#maxFragments > 0 && + this.#fragments.length === this.#maxFragments + ) { + failWebsocketConnectionWithCode(this.ws, 1008, 'Too many message fragments') + return false + } + this.#fragmentsBytes += fragment.length this.#fragments.push(fragment) + return true } consumeFragments () { @@ -33530,15 +33663,15 @@ module.exports = { /***/ }), -/***/ 5164: +/***/ 7526: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { WebsocketFrameSend } = __nccwpck_require__(2928) -const { opcodes, sendHints } = __nccwpck_require__(2512) -const FixedQueue = __nccwpck_require__(8692) +const { WebsocketFrameSend } = __nccwpck_require__(9506) +const { opcodes, sendHints } = __nccwpck_require__(362) +const FixedQueue = __nccwpck_require__(894) /** @type {typeof Uint8Array} */ const FastBuffer = Buffer[Symbol.species] @@ -33642,7 +33775,7 @@ module.exports = { SendQueue } /***/ }), -/***/ 9360: +/***/ 6858: /***/ ((module) => { "use strict"; @@ -33662,17 +33795,17 @@ module.exports = { /***/ }), -/***/ 4081: +/***/ 343: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(9360) -const { states, opcodes } = __nccwpck_require__(2512) -const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(8916) +const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(6858) +const { states, opcodes } = __nccwpck_require__(362) +const { ErrorEvent, createFastMessageEvent } = __nccwpck_require__(4926) const { isUtf8 } = __nccwpck_require__(4573) -const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(8828) +const { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = __nccwpck_require__(4622) /* globals Blob */ @@ -33992,16 +34125,16 @@ module.exports = { /***/ }), -/***/ 5134: +/***/ 9480: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const { webidl } = __nccwpck_require__(613) -const { URLSerializer } = __nccwpck_require__(8828) -const { environmentSettingsObject } = __nccwpck_require__(9808) -const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(2512) +const { webidl } = __nccwpck_require__(4195) +const { URLSerializer } = __nccwpck_require__(4622) +const { environmentSettingsObject } = __nccwpck_require__(9614) +const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = __nccwpck_require__(362) const { kWebSocketURL, kReadyState, @@ -34010,21 +34143,21 @@ const { kResponse, kSentClose, kByteParser -} = __nccwpck_require__(9360) +} = __nccwpck_require__(6858) const { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent -} = __nccwpck_require__(4081) -const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(737) -const { ByteParser } = __nccwpck_require__(148) -const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3792) -const { getGlobalDispatcher } = __nccwpck_require__(197) +} = __nccwpck_require__(343) +const { establishWebSocketConnection, closeWebSocketConnection } = __nccwpck_require__(2379) +const { ByteParser } = __nccwpck_require__(4658) +const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(2250) +const { getGlobalDispatcher } = __nccwpck_require__(6759) const { types } = __nccwpck_require__(7975) -const { ErrorEvent, CloseEvent } = __nccwpck_require__(8916) -const { SendQueue } = __nccwpck_require__(5164) +const { ErrorEvent, CloseEvent } = __nccwpck_require__(4926) +const { SendQueue } = __nccwpck_require__(7526) // https://websockets.spec.whatwg.org/#interface-definition class WebSocket extends EventTarget { @@ -34433,9 +34566,12 @@ class WebSocket extends EventTarget { // once this happens, the connection is open this[kResponse] = response - const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize + const webSocketOptions = this[kController]?.dispatcher?.webSocketOptions + const maxFragments = webSocketOptions?.maxFragments + const maxPayloadSize = webSocketOptions?.maxPayloadSize const parser = new ByteParser(this, parsedExtensions, { + maxFragments, maxPayloadSize }) parser.on('drain', onParserDrain) @@ -35011,13 +35147,13 @@ exports.range = range; /***/ }), -/***/ 8797: +/***/ 5994: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EXPANSION_MAX = void 0; +exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0; exports.expand = expand; const balanced_match_1 = __nccwpck_require__(5192); const escSlash = '\0SLASH' + Math.random() + '\0'; @@ -35036,6 +35172,17 @@ const closePattern = /\\}/g; const commaPattern = /\\,/g; const periodPattern = /\\\./g; exports.EXPANSION_MAX = 100_000; +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +exports.EXPANSION_MAX_LENGTH = 4_000_000; function numeric(str) { return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); } @@ -35085,7 +35232,7 @@ function expand(str, options = {}) { if (!str) { return []; } - const { max = exports.EXPANSION_MAX } = options; + const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, @@ -35095,7 +35242,7 @@ function expand(str, options = {}) { if (str.slice(0, 2) === '{}') { str = '\\{\\}' + str.slice(2); } - return expand_(escapeBraces(str), max, true).map(unescapeBraces); + return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); } function embrace(str) { return '{' + str + '}'; @@ -35109,22 +35256,117 @@ function lte(i, y) { function gte(i, y) { return i >= y; } -function expand_(str, max, isTop) { - /** @type {string[]} */ - const expansions = []; - const m = (0, balanced_match_1.balanced)('{', '}', str); - if (!m) - return [str]; - // no need to expand pre, since it is guaranteed to be free of brace-sets - const pre = m.pre; - const post = m.post.length ? expand_(m.post, max, false) : ['']; - if (/\$$/.test(m.pre)) { - for (let k = 0; k < post.length && k < max; k++) { - const expansion = pre + '{' + m.body + '}' + post[k]; - expansions.push(expansion); +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +function combine(acc, pre, values, max, maxLength, dropEmpties) { + const out = []; + let length = 0; + for (let a = 0; a < acc.length; a++) { + for (let v = 0; v < values.length; v++) { + if (out.length >= max) + return out; + const expansion = acc[a] + pre + values[v]; + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. + if (dropEmpties && !expansion) + continue; + if (length + expansion.length > maxLength) + return out; + out.push(expansion); + length += expansion.length; } } - else { + return out; +} +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence(body, isAlphaSequence, max, maxLength) { + const n = body.split(/\.\./); + const N = []; + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N; + } + /* c8 ignore stop */ + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + let length = 0; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + if (length + c.length > maxLength) + break; + N.push(c); + length += c.length; + } + return N; +} +function expand_(str, max, maxLength, isTop) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + let acc = ['']; + // Bash drops empty results, but only when the *first* top-level group is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + let dropEmpties = false; + let firstGroup = true; + for (;;) { + const m = (0, balanced_match_1.balanced)('{', '}', str); + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, str, [''], max, maxLength, dropEmpties); + } + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + if (/\$$/.test(pre)) { + acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length); + firstGroup = false; + if (!m.post.length) + break; + str = m.post; + continue; + } const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); const isSequence = isNumericSequence || isAlphaSequence; @@ -35133,87 +35375,69 @@ function expand_(str, max, isTop) { // {a},b} if (m.post.match(/,(?!,).*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; - return expand_(str, max, true); + isTop = true; + continue; } - return [str]; + // Nothing here expands, so the whole remaining string is literal. + return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties); } - let n; + if (firstGroup) { + dropEmpties = isTop && !isSequence; + firstGroup = false; + } + let values; if (isSequence) { - n = m.body.split(/\.\./); + values = expandSequence(m.body, isAlphaSequence, max, maxLength); } else { - n = parseCommaParts(m.body); + let n = parseCommaParts(m.body); if (n.length === 1 && n[0] !== undefined) { // x{{a,b}}y ==> x{a}y x{b}y - n = expand_(n[0], max, false).map(embrace); + n = expand_(n[0], max, maxLength, false).map(embrace); //XXX is this necessary? Can't seem to hit it in tests. /* c8 ignore start */ if (n.length === 1) { - return post.map(p => m.pre + n[0] + p); + acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + continue; } /* c8 ignore stop */ } - } - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - let N; - if (isSequence && n[0] !== undefined && n[1] !== undefined) { - const x = numeric(n[0]); - const y = numeric(n[1]); - const width = Math.max(n[0].length, n[1].length); - let incr = n.length === 3 && n[2] !== undefined ? - Math.max(Math.abs(numeric(n[2])), 1) - : 1; - let test = lte; - const reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - const pad = n.some(isPadded); - N = []; - for (let i = x; test(i, y) && N.length < max; i += incr) { - let c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') { - c = ''; - } - } - else { - c = String(i); - if (pad) { - const need = width - c.length; - if (need > 0) { - const z = new Array(need + 1).join('0'); - if (i < 0) { - c = '-' + z + c.slice(1); - } - else { - c = z + c; - } - } - } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; } - N.push(c); - } - } - else { - N = []; - for (let j = 0; j < n.length; j++) { - N.push.apply(N, expand_(n[j], max, false)); } - } - for (let j = 0; j < N.length; j++) { - for (let k = 0; k < post.length && expansions.length < max; k++) { - const expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) { - expansions.push(expansion); + values = []; + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; } } } + acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; } - return expansions; + return acc; } //# sourceMappingURL=index.js.map @@ -36471,7 +36695,7 @@ exports.escape = escape; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; -const brace_expansion_1 = __nccwpck_require__(8797); +const brace_expansion_1 = __nccwpck_require__(5994); const assert_valid_pattern_js_1 = __nccwpck_require__(2012); const ast_js_1 = __nccwpck_require__(5492); const escape_js_1 = __nccwpck_require__(6917);