|
@@ -0,0 +1,3846 @@
|
|
|
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
+From: Shelley Vohr <[email protected]>
|
|
|
+Date: Wed, 17 Jan 2024 13:27:13 +0100
|
|
|
+Subject: fix: undici incorrectly copies headers onto fetches
|
|
|
+
|
|
|
+Refs https://github.com/nodejs/node/pull/50153
|
|
|
+Refs https://github.com/nodejs/undici/pull/2359
|
|
|
+
|
|
|
+Fixes an issue where undici in migrating build scripts accidentally
|
|
|
+regressed constructor name exports.
|
|
|
+
|
|
|
+This is fixed in Node.js v20.10.0 and beyond by https://github.com/nodejs/node/pull/50274
|
|
|
+but as that PR is very large, this cherry-picks out just the fix for the constructor issue
|
|
|
+by running the build script with the missing `keepNames` argument and copying the resulting
|
|
|
+undici-fetch.js output to deps/undici/undici.js, as Node.js themselves do in their
|
|
|
+update scripts: https://github.com/nodejs/node/blob/2860631359ee49388b5873b7a8c5ad1e00ebf319/tools/dep_updaters/update-undici.sh#L54
|
|
|
+
|
|
|
+diff --git a/deps/undici/undici.js b/deps/undici/undici.js
|
|
|
+index 0c3dc7ebfc149b839f4ac2fe3cdeea0b3b754be9..0acf5ac97a3a5e83bd683eb052764cc8d0dfce5c 100644
|
|
|
+--- a/deps/undici/undici.js
|
|
|
++++ b/deps/undici/undici.js
|
|
|
+@@ -1,5 +1,7 @@
|
|
|
+ "use strict";
|
|
|
++var __defProp = Object.defineProperty;
|
|
|
+ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
++var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
|
+ var __commonJS = (cb, mod) => function __require() {
|
|
|
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
|
+ };
|
|
|
+@@ -91,6 +93,9 @@ var require_errors = __commonJS({
|
|
|
+ "lib/core/errors.js"(exports2, module2) {
|
|
|
+ "use strict";
|
|
|
+ var UndiciError = class extends Error {
|
|
|
++ static {
|
|
|
++ __name(this, "UndiciError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ this.name = "UndiciError";
|
|
|
+@@ -98,6 +103,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var ConnectTimeoutError = class _ConnectTimeoutError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "ConnectTimeoutError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _ConnectTimeoutError);
|
|
|
+@@ -107,6 +115,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var HeadersTimeoutError = class _HeadersTimeoutError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "HeadersTimeoutError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _HeadersTimeoutError);
|
|
|
+@@ -116,6 +127,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var HeadersOverflowError = class _HeadersOverflowError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "HeadersOverflowError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _HeadersOverflowError);
|
|
|
+@@ -125,6 +139,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var BodyTimeoutError = class _BodyTimeoutError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "BodyTimeoutError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _BodyTimeoutError);
|
|
|
+@@ -134,6 +151,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var ResponseStatusCodeError = class _ResponseStatusCodeError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "ResponseStatusCodeError");
|
|
|
++ }
|
|
|
+ constructor(message, statusCode, headers, body) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _ResponseStatusCodeError);
|
|
|
+@@ -147,6 +167,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var InvalidArgumentError = class _InvalidArgumentError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "InvalidArgumentError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _InvalidArgumentError);
|
|
|
+@@ -156,6 +179,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var InvalidReturnValueError = class _InvalidReturnValueError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "InvalidReturnValueError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _InvalidReturnValueError);
|
|
|
+@@ -165,6 +191,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var RequestAbortedError = class _RequestAbortedError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "RequestAbortedError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _RequestAbortedError);
|
|
|
+@@ -174,6 +203,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var InformationalError = class _InformationalError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "InformationalError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _InformationalError);
|
|
|
+@@ -183,6 +215,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var RequestContentLengthMismatchError = class _RequestContentLengthMismatchError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "RequestContentLengthMismatchError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _RequestContentLengthMismatchError);
|
|
|
+@@ -192,6 +227,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var ResponseContentLengthMismatchError = class _ResponseContentLengthMismatchError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "ResponseContentLengthMismatchError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _ResponseContentLengthMismatchError);
|
|
|
+@@ -201,6 +239,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var ClientDestroyedError = class _ClientDestroyedError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "ClientDestroyedError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _ClientDestroyedError);
|
|
|
+@@ -210,6 +251,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var ClientClosedError = class _ClientClosedError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "ClientClosedError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _ClientClosedError);
|
|
|
+@@ -219,6 +263,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var SocketError = class _SocketError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "SocketError");
|
|
|
++ }
|
|
|
+ constructor(message, socket) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _SocketError);
|
|
|
+@@ -229,6 +276,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var NotSupportedError = class _NotSupportedError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "NotSupportedError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _NotSupportedError);
|
|
|
+@@ -238,6 +288,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var BalancedPoolMissingUpstreamError = class extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "BalancedPoolMissingUpstreamError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, NotSupportedError);
|
|
|
+@@ -247,6 +300,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var HTTPParserError = class _HTTPParserError extends Error {
|
|
|
++ static {
|
|
|
++ __name(this, "HTTPParserError");
|
|
|
++ }
|
|
|
+ constructor(message, code, data) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _HTTPParserError);
|
|
|
+@@ -256,6 +312,9 @@ var require_errors = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var ResponseExceededMaxSizeError = class _ResponseExceededMaxSizeError extends UndiciError {
|
|
|
++ static {
|
|
|
++ __name(this, "ResponseExceededMaxSizeError");
|
|
|
++ }
|
|
|
+ constructor(message) {
|
|
|
+ super(message);
|
|
|
+ Error.captureStackTrace(this, _ResponseExceededMaxSizeError);
|
|
|
+@@ -304,12 +363,15 @@ var require_util = __commonJS({
|
|
|
+ var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v));
|
|
|
+ function nop() {
|
|
|
+ }
|
|
|
++ __name(nop, "nop");
|
|
|
+ function isStream(obj) {
|
|
|
+ return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function";
|
|
|
+ }
|
|
|
++ __name(isStream, "isStream");
|
|
|
+ function isBlobLike(object) {
|
|
|
+ return Blob2 && object instanceof Blob2 || object && typeof object === "object" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]);
|
|
|
+ }
|
|
|
++ __name(isBlobLike, "isBlobLike");
|
|
|
+ function buildURL(url, queryParams) {
|
|
|
+ if (url.includes("?") || url.includes("#")) {
|
|
|
+ throw new Error('Query params cannot be passed when url already contains "?" or "#".');
|
|
|
+@@ -320,6 +382,7 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ return url;
|
|
|
+ }
|
|
|
++ __name(buildURL, "buildURL");
|
|
|
+ function parseURL(url) {
|
|
|
+ if (typeof url === "string") {
|
|
|
+ url = new URL(url);
|
|
|
+@@ -331,25 +394,25 @@ var require_util = __commonJS({
|
|
|
+ if (!url || typeof url !== "object") {
|
|
|
+ throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object.");
|
|
|
+ }
|
|
|
++ if (url.port != null && url.port !== "" && !Number.isFinite(parseInt(url.port))) {
|
|
|
++ throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer.");
|
|
|
++ }
|
|
|
++ if (url.path != null && typeof url.path !== "string") {
|
|
|
++ throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined.");
|
|
|
++ }
|
|
|
++ if (url.pathname != null && typeof url.pathname !== "string") {
|
|
|
++ throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined.");
|
|
|
++ }
|
|
|
++ if (url.hostname != null && typeof url.hostname !== "string") {
|
|
|
++ throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined.");
|
|
|
++ }
|
|
|
++ if (url.origin != null && typeof url.origin !== "string") {
|
|
|
++ throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined.");
|
|
|
++ }
|
|
|
+ if (!/^https?:/.test(url.origin || url.protocol)) {
|
|
|
+ throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
|
+ }
|
|
|
+ if (!(url instanceof URL)) {
|
|
|
+- if (url.port != null && url.port !== "" && !Number.isFinite(parseInt(url.port))) {
|
|
|
+- throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer.");
|
|
|
+- }
|
|
|
+- if (url.path != null && typeof url.path !== "string") {
|
|
|
+- throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined.");
|
|
|
+- }
|
|
|
+- if (url.pathname != null && typeof url.pathname !== "string") {
|
|
|
+- throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined.");
|
|
|
+- }
|
|
|
+- if (url.hostname != null && typeof url.hostname !== "string") {
|
|
|
+- throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined.");
|
|
|
+- }
|
|
|
+- if (url.origin != null && typeof url.origin !== "string") {
|
|
|
+- throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined.");
|
|
|
+- }
|
|
|
+ const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
|
+ let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}`;
|
|
|
+ let path = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
|
+@@ -363,6 +426,7 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ return url;
|
|
|
+ }
|
|
|
++ __name(parseURL, "parseURL");
|
|
|
+ function parseOrigin(url) {
|
|
|
+ url = parseURL(url);
|
|
|
+ if (url.pathname !== "/" || url.search || url.hash) {
|
|
|
+@@ -370,6 +434,7 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ return url;
|
|
|
+ }
|
|
|
++ __name(parseOrigin, "parseOrigin");
|
|
|
+ function getHostname(host) {
|
|
|
+ if (host[0] === "[") {
|
|
|
+ const idx2 = host.indexOf("]");
|
|
|
+@@ -381,6 +446,7 @@ var require_util = __commonJS({
|
|
|
+ return host;
|
|
|
+ return host.substr(0, idx);
|
|
|
+ }
|
|
|
++ __name(getHostname, "getHostname");
|
|
|
+ function getServerName(host) {
|
|
|
+ if (!host) {
|
|
|
+ return null;
|
|
|
+@@ -392,15 +458,19 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ return servername;
|
|
|
+ }
|
|
|
++ __name(getServerName, "getServerName");
|
|
|
+ function deepClone(obj) {
|
|
|
+ return JSON.parse(JSON.stringify(obj));
|
|
|
+ }
|
|
|
++ __name(deepClone, "deepClone");
|
|
|
+ function isAsyncIterable(obj) {
|
|
|
+ return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function");
|
|
|
+ }
|
|
|
++ __name(isAsyncIterable, "isAsyncIterable");
|
|
|
+ function isIterable(obj) {
|
|
|
+ return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function"));
|
|
|
+ }
|
|
|
++ __name(isIterable, "isIterable");
|
|
|
+ function bodyLength(body) {
|
|
|
+ if (body == null) {
|
|
|
+ return 0;
|
|
|
+@@ -414,13 +484,16 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
++ __name(bodyLength, "bodyLength");
|
|
|
+ function isDestroyed(stream2) {
|
|
|
+ return !stream2 || !!(stream2.destroyed || stream2[kDestroyed]);
|
|
|
+ }
|
|
|
++ __name(isDestroyed, "isDestroyed");
|
|
|
+ function isReadableAborted(stream2) {
|
|
|
+ const state = stream2 && stream2._readableState;
|
|
|
+ return isDestroyed(stream2) && state && !state.endEmitted;
|
|
|
+ }
|
|
|
++ __name(isReadableAborted, "isReadableAborted");
|
|
|
+ function destroy(stream2, err) {
|
|
|
+ if (!isStream(stream2) || isDestroyed(stream2)) {
|
|
|
+ return;
|
|
|
+@@ -439,11 +512,13 @@ var require_util = __commonJS({
|
|
|
+ stream2[kDestroyed] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(destroy, "destroy");
|
|
|
+ var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/;
|
|
|
+ function parseKeepAliveTimeout(val) {
|
|
|
+ const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR);
|
|
|
+ return m ? parseInt(m[1], 10) * 1e3 : null;
|
|
|
+ }
|
|
|
++ __name(parseKeepAliveTimeout, "parseKeepAliveTimeout");
|
|
|
+ function parseHeaders(headers, obj = {}) {
|
|
|
+ if (!Array.isArray(headers))
|
|
|
+ return headers;
|
|
|
+@@ -469,6 +544,7 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
++ __name(parseHeaders, "parseHeaders");
|
|
|
+ function parseRawHeaders(headers) {
|
|
|
+ const ret = [];
|
|
|
+ let hasContentLength = false;
|
|
|
+@@ -490,9 +566,11 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
++ __name(parseRawHeaders, "parseRawHeaders");
|
|
|
+ function isBuffer(buffer) {
|
|
|
+ return buffer instanceof Uint8Array || Buffer.isBuffer(buffer);
|
|
|
+ }
|
|
|
++ __name(isBuffer, "isBuffer");
|
|
|
+ function validateHandler(handler, method, upgrade) {
|
|
|
+ if (!handler || typeof handler !== "object") {
|
|
|
+ throw new InvalidArgumentError("handler must be an object");
|
|
|
+@@ -522,19 +600,23 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(validateHandler, "validateHandler");
|
|
|
+ function isDisturbed(body) {
|
|
|
+ return !!(body && (stream.isDisturbed ? stream.isDisturbed(body) || body[kBodyUsed] : body[kBodyUsed] || body.readableDidRead || body._readableState && body._readableState.dataEmitted || isReadableAborted(body)));
|
|
|
+ }
|
|
|
++ __name(isDisturbed, "isDisturbed");
|
|
|
+ function isErrored(body) {
|
|
|
+ return !!(body && (stream.isErrored ? stream.isErrored(body) : /state: 'errored'/.test(
|
|
|
+ nodeUtil.inspect(body)
|
|
|
+ )));
|
|
|
+ }
|
|
|
++ __name(isErrored, "isErrored");
|
|
|
+ function isReadable(body) {
|
|
|
+ return !!(body && (stream.isReadable ? stream.isReadable(body) : /state: 'readable'/.test(
|
|
|
+ nodeUtil.inspect(body)
|
|
|
+ )));
|
|
|
+ }
|
|
|
++ __name(isReadable, "isReadable");
|
|
|
+ function getSocketInfo(socket) {
|
|
|
+ return {
|
|
|
+ localAddress: socket.localAddress,
|
|
|
+@@ -547,11 +629,13 @@ var require_util = __commonJS({
|
|
|
+ bytesRead: socket.bytesRead
|
|
|
+ };
|
|
|
+ }
|
|
|
++ __name(getSocketInfo, "getSocketInfo");
|
|
|
+ async function* convertIterableToBuffer(iterable) {
|
|
|
+ for await (const chunk of iterable) {
|
|
|
+ yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(convertIterableToBuffer, "convertIterableToBuffer");
|
|
|
+ var ReadableStream;
|
|
|
+ function ReadableStreamFrom(iterable) {
|
|
|
+ if (!ReadableStream) {
|
|
|
+@@ -585,9 +669,11 @@ var require_util = __commonJS({
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ }
|
|
|
++ __name(ReadableStreamFrom, "ReadableStreamFrom");
|
|
|
+ function isFormDataLike(object) {
|
|
|
+ return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData";
|
|
|
+ }
|
|
|
++ __name(isFormDataLike, "isFormDataLike");
|
|
|
+ function throwIfAborted(signal) {
|
|
|
+ if (!signal) {
|
|
|
+ return;
|
|
|
+@@ -602,6 +688,7 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(throwIfAborted, "throwIfAborted");
|
|
|
+ var events;
|
|
|
+ function addAbortListener(signal, listener) {
|
|
|
+ if (typeof Symbol.dispose === "symbol") {
|
|
|
+@@ -619,6 +706,7 @@ var require_util = __commonJS({
|
|
|
+ signal.addListener("abort", listener);
|
|
|
+ return () => signal.removeListener("abort", listener);
|
|
|
+ }
|
|
|
++ __name(addAbortListener, "addAbortListener");
|
|
|
+ var hasToWellFormed = !!String.prototype.toWellFormed;
|
|
|
+ function toUSVString(val) {
|
|
|
+ if (hasToWellFormed) {
|
|
|
+@@ -628,6 +716,7 @@ var require_util = __commonJS({
|
|
|
+ }
|
|
|
+ return `${val}`;
|
|
|
+ }
|
|
|
++ __name(toUSVString, "toUSVString");
|
|
|
+ var kEnumerableProperty = /* @__PURE__ */ Object.create(null);
|
|
|
+ kEnumerableProperty.enumerable = true;
|
|
|
+ module2.exports = {
|
|
|
+@@ -819,7 +908,7 @@ var require_constants = __commonJS({
|
|
|
+ var channel;
|
|
|
+ var structuredClone = globalThis.structuredClone ?? // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
|
|
|
+ // structuredClone was added in v17.0.0, but fetch supports v16.8
|
|
|
+- function structuredClone2(value, options = void 0) {
|
|
|
++ /* @__PURE__ */ __name(function structuredClone2(value, options = void 0) {
|
|
|
+ if (arguments.length === 0) {
|
|
|
+ throw new TypeError("missing argument");
|
|
|
+ }
|
|
|
+@@ -830,7 +919,7 @@ var require_constants = __commonJS({
|
|
|
+ channel.port2.unref();
|
|
|
+ channel.port1.postMessage(value, options?.transfer);
|
|
|
+ return receiveMessageOnPort(channel.port2).message;
|
|
|
+- };
|
|
|
++ }, "structuredClone");
|
|
|
+ module2.exports = {
|
|
|
+ DOMException,
|
|
|
+ structuredClone,
|
|
|
+@@ -860,7 +949,11 @@ var require_global = __commonJS({
|
|
|
+ function getGlobalOrigin() {
|
|
|
+ return globalThis[globalOrigin];
|
|
|
+ }
|
|
|
++ __name(getGlobalOrigin, "getGlobalOrigin");
|
|
|
+ function setGlobalOrigin(newOrigin) {
|
|
|
++ if (newOrigin !== void 0 && typeof newOrigin !== "string" && !(newOrigin instanceof URL)) {
|
|
|
++ throw new Error("Invalid base url");
|
|
|
++ }
|
|
|
+ if (newOrigin === void 0) {
|
|
|
+ Object.defineProperty(globalThis, globalOrigin, {
|
|
|
+ value: void 0,
|
|
|
+@@ -881,6 +974,7 @@ var require_global = __commonJS({
|
|
|
+ configurable: false
|
|
|
+ });
|
|
|
+ }
|
|
|
++ __name(setGlobalOrigin, "setGlobalOrigin");
|
|
|
+ module2.exports = {
|
|
|
+ getGlobalOrigin,
|
|
|
+ setGlobalOrigin
|
|
|
+@@ -908,6 +1002,7 @@ var require_util2 = __commonJS({
|
|
|
+ const length = urlList.length;
|
|
|
+ return length === 0 ? null : urlList[length - 1].toString();
|
|
|
+ }
|
|
|
++ __name(responseURL, "responseURL");
|
|
|
+ function responseLocationURL(response, requestFragment) {
|
|
|
+ if (!redirectStatus.includes(response.status)) {
|
|
|
+ return null;
|
|
|
+@@ -921,9 +1016,11 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return location;
|
|
|
+ }
|
|
|
++ __name(responseLocationURL, "responseLocationURL");
|
|
|
+ function requestCurrentURL(request) {
|
|
|
+ return request.urlList[request.urlList.length - 1];
|
|
|
+ }
|
|
|
++ __name(requestCurrentURL, "requestCurrentURL");
|
|
|
+ function requestBadPort(request) {
|
|
|
+ const url = requestCurrentURL(request);
|
|
|
+ if (urlIsHttpHttpsScheme(url) && badPorts.includes(url.port)) {
|
|
|
+@@ -931,23 +1028,27 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return "allowed";
|
|
|
+ }
|
|
|
++ __name(requestBadPort, "requestBadPort");
|
|
|
+ function isErrorLike(object) {
|
|
|
+ return object instanceof Error || (object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException");
|
|
|
+ }
|
|
|
++ __name(isErrorLike, "isErrorLike");
|
|
|
+ function isValidReasonPhrase(statusText) {
|
|
|
+ for (let i = 0; i < statusText.length; ++i) {
|
|
|
+ const c = statusText.charCodeAt(i);
|
|
|
+ if (!(c === 9 || // HTAB
|
|
|
+- c >= 32 && c <= 126 || // SP / VCHAR
|
|
|
+- c >= 128 && c <= 255)) {
|
|
|
++ c >= 32 && c <= 126 || // SP / VCHAR
|
|
|
++ c >= 128 && c <= 255)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
++ __name(isValidReasonPhrase, "isValidReasonPhrase");
|
|
|
+ function isTokenChar(c) {
|
|
|
+ return !(c >= 127 || c <= 32 || c === "(" || c === ")" || c === "<" || c === ">" || c === "@" || c === "," || c === ";" || c === ":" || c === "\\" || c === '"' || c === "/" || c === "[" || c === "]" || c === "?" || c === "=" || c === "{" || c === "}");
|
|
|
+ }
|
|
|
++ __name(isTokenChar, "isTokenChar");
|
|
|
+ function isValidHTTPToken(characters) {
|
|
|
+ if (!characters || typeof characters !== "string") {
|
|
|
+ return false;
|
|
|
+@@ -960,12 +1061,14 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
++ __name(isValidHTTPToken, "isValidHTTPToken");
|
|
|
+ function isValidHeaderName(potentialValue) {
|
|
|
+ if (potentialValue.length === 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return isValidHTTPToken(potentialValue);
|
|
|
+ }
|
|
|
++ __name(isValidHeaderName, "isValidHeaderName");
|
|
|
+ function isValidHeaderValue(potentialValue) {
|
|
|
+ if (potentialValue.startsWith(" ") || potentialValue.startsWith(" ") || potentialValue.endsWith(" ") || potentialValue.endsWith(" ")) {
|
|
|
+ return false;
|
|
|
+@@ -975,6 +1078,7 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
++ __name(isValidHeaderValue, "isValidHeaderValue");
|
|
|
+ function setRequestReferrerPolicyOnRedirect(request, actualResponse) {
|
|
|
+ const { headersList } = actualResponse;
|
|
|
+ const policyHeader = (headersList.get("referrer-policy") ?? "").split(",");
|
|
|
+@@ -992,20 +1096,25 @@ var require_util2 = __commonJS({
|
|
|
+ request.referrerPolicy = policy;
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(setRequestReferrerPolicyOnRedirect, "setRequestReferrerPolicyOnRedirect");
|
|
|
+ function crossOriginResourcePolicyCheck() {
|
|
|
+ return "allowed";
|
|
|
+ }
|
|
|
++ __name(crossOriginResourcePolicyCheck, "crossOriginResourcePolicyCheck");
|
|
|
+ function corsCheck() {
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
++ __name(corsCheck, "corsCheck");
|
|
|
+ function TAOCheck() {
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
++ __name(TAOCheck, "TAOCheck");
|
|
|
+ function appendFetchMetadata(httpRequest) {
|
|
|
+ let header = null;
|
|
|
+ header = httpRequest.mode;
|
|
|
+ httpRequest.headersList.set("sec-fetch-mode", header);
|
|
|
+ }
|
|
|
++ __name(appendFetchMetadata, "appendFetchMetadata");
|
|
|
+ function appendRequestOriginHeader(request) {
|
|
|
+ let serializedOrigin = request.origin;
|
|
|
+ if (request.responseTainting === "cors" || request.mode === "websocket") {
|
|
|
+@@ -1036,9 +1145,11 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(appendRequestOriginHeader, "appendRequestOriginHeader");
|
|
|
+ function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) {
|
|
|
+ return performance2.now();
|
|
|
+ }
|
|
|
++ __name(coarsenedSharedCurrentTime, "coarsenedSharedCurrentTime");
|
|
|
+ function createOpaqueTimingInfo(timingInfo) {
|
|
|
+ return {
|
|
|
+ startTime: timingInfo.startTime ?? 0,
|
|
|
+@@ -1054,16 +1165,19 @@ var require_util2 = __commonJS({
|
|
|
+ finalConnectionTimingInfo: null
|
|
|
+ };
|
|
|
+ }
|
|
|
++ __name(createOpaqueTimingInfo, "createOpaqueTimingInfo");
|
|
|
+ function makePolicyContainer() {
|
|
|
+ return {
|
|
|
+ referrerPolicy: "strict-origin-when-cross-origin"
|
|
|
+ };
|
|
|
+ }
|
|
|
++ __name(makePolicyContainer, "makePolicyContainer");
|
|
|
+ function clonePolicyContainer(policyContainer) {
|
|
|
+ return {
|
|
|
+ referrerPolicy: policyContainer.referrerPolicy
|
|
|
+ };
|
|
|
+ }
|
|
|
++ __name(clonePolicyContainer, "clonePolicyContainer");
|
|
|
+ function determineRequestsReferrer(request) {
|
|
|
+ const policy = request.referrerPolicy;
|
|
|
+ assert(policy);
|
|
|
+@@ -1109,6 +1223,7 @@ var require_util2 = __commonJS({
|
|
|
+ return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin;
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(determineRequestsReferrer, "determineRequestsReferrer");
|
|
|
+ function stripURLForReferrer(url, originOnly) {
|
|
|
+ assert(url instanceof URL);
|
|
|
+ if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") {
|
|
|
+@@ -1123,6 +1238,7 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return url;
|
|
|
+ }
|
|
|
++ __name(stripURLForReferrer, "stripURLForReferrer");
|
|
|
+ function isURLPotentiallyTrustworthy(url) {
|
|
|
+ if (!(url instanceof URL)) {
|
|
|
+ return false;
|
|
|
+@@ -1147,7 +1263,9 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
++ __name(isOriginPotentiallyTrustworthy, "isOriginPotentiallyTrustworthy");
|
|
|
+ }
|
|
|
++ __name(isURLPotentiallyTrustworthy, "isURLPotentiallyTrustworthy");
|
|
|
+ function bytesMatch(bytes, metadataList) {
|
|
|
+ if (crypto === void 0) {
|
|
|
+ return true;
|
|
|
+@@ -1185,6 +1303,7 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
++ __name(bytesMatch, "bytesMatch");
|
|
|
+ var parseHashWithOptions = /((?<algo>sha256|sha384|sha512)-(?<hash>[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i;
|
|
|
+ function parseMetadata(metadata) {
|
|
|
+ const result = [];
|
|
|
+@@ -1206,8 +1325,10 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
++ __name(parseMetadata, "parseMetadata");
|
|
|
+ function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) {
|
|
|
+ }
|
|
|
++ __name(tryUpgradeRequestToAPotentiallyTrustworthyURL, "tryUpgradeRequestToAPotentiallyTrustworthyURL");
|
|
|
+ function sameOrigin(A, B) {
|
|
|
+ if (A.origin === B.origin && A.origin === "null") {
|
|
|
+ return true;
|
|
|
+@@ -1217,6 +1338,7 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
++ __name(sameOrigin, "sameOrigin");
|
|
|
+ function createDeferredPromise() {
|
|
|
+ let res;
|
|
|
+ let rej;
|
|
|
+@@ -1226,15 +1348,19 @@ var require_util2 = __commonJS({
|
|
|
+ });
|
|
|
+ return { promise, resolve: res, reject: rej };
|
|
|
+ }
|
|
|
++ __name(createDeferredPromise, "createDeferredPromise");
|
|
|
+ function isAborted(fetchParams) {
|
|
|
+ return fetchParams.controller.state === "aborted";
|
|
|
+ }
|
|
|
++ __name(isAborted, "isAborted");
|
|
|
+ function isCancelled(fetchParams) {
|
|
|
+ return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated";
|
|
|
+ }
|
|
|
++ __name(isCancelled, "isCancelled");
|
|
|
+ function normalizeMethod(method) {
|
|
|
+ return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method) ? method.toUpperCase() : method;
|
|
|
+ }
|
|
|
++ __name(normalizeMethod, "normalizeMethod");
|
|
|
+ function serializeJavascriptValueToJSONString(value) {
|
|
|
+ const result = JSON.stringify(value);
|
|
|
+ if (result === void 0) {
|
|
|
+@@ -1243,6 +1369,7 @@ var require_util2 = __commonJS({
|
|
|
+ assert(typeof result === "string");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
++ __name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
|
|
|
+ var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));
|
|
|
+ function makeIterator(iterator, name, kind) {
|
|
|
+ const object = {
|
|
|
+@@ -1274,6 +1401,7 @@ var require_util2 = __commonJS({
|
|
|
+ Object.setPrototypeOf(i, esIteratorPrototype);
|
|
|
+ return Object.setPrototypeOf({}, i);
|
|
|
+ }
|
|
|
++ __name(makeIterator, "makeIterator");
|
|
|
+ function iteratorResult(pair, kind) {
|
|
|
+ let result;
|
|
|
+ switch (kind) {
|
|
|
+@@ -1292,6 +1420,7 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return { value: result, done: false };
|
|
|
+ }
|
|
|
++ __name(iteratorResult, "iteratorResult");
|
|
|
+ async function fullyReadBody(body, processBody, processBodyError) {
|
|
|
+ const successSteps = processBody;
|
|
|
+ const errorSteps = processBodyError;
|
|
|
+@@ -1309,6 +1438,7 @@ var require_util2 = __commonJS({
|
|
|
+ errorSteps(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(fullyReadBody, "fullyReadBody");
|
|
|
+ var ReadableStream = globalThis.ReadableStream;
|
|
|
+ function isReadableStreamLike(stream) {
|
|
|
+ if (!ReadableStream) {
|
|
|
+@@ -1316,6 +1446,7 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function";
|
|
|
+ }
|
|
|
++ __name(isReadableStreamLike, "isReadableStreamLike");
|
|
|
+ var MAXIMUM_ARGUMENT_LENGTH = 65535;
|
|
|
+ function isomorphicDecode(input) {
|
|
|
+ if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
|
|
|
+@@ -1323,6 +1454,7 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ return input.reduce((previous, current) => previous + String.fromCharCode(current), "");
|
|
|
+ }
|
|
|
++ __name(isomorphicDecode, "isomorphicDecode");
|
|
|
+ function readableStreamClose(controller) {
|
|
|
+ try {
|
|
|
+ controller.close();
|
|
|
+@@ -1332,12 +1464,14 @@ var require_util2 = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(readableStreamClose, "readableStreamClose");
|
|
|
+ function isomorphicEncode(input) {
|
|
|
+ for (let i = 0; i < input.length; i++) {
|
|
|
+ assert(input.charCodeAt(i) <= 255);
|
|
|
+ }
|
|
|
+ return input;
|
|
|
+ }
|
|
|
++ __name(isomorphicEncode, "isomorphicEncode");
|
|
|
+ async function readAllBytes(reader) {
|
|
|
+ const bytes = [];
|
|
|
+ let byteLength = 0;
|
|
|
+@@ -1353,22 +1487,26 @@ var require_util2 = __commonJS({
|
|
|
+ byteLength += chunk.length;
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(readAllBytes, "readAllBytes");
|
|
|
+ function urlIsLocal(url) {
|
|
|
+ assert("protocol" in url);
|
|
|
+ const protocol = url.protocol;
|
|
|
+ return protocol === "about:" || protocol === "blob:" || protocol === "data:";
|
|
|
+ }
|
|
|
++ __name(urlIsLocal, "urlIsLocal");
|
|
|
+ function urlHasHttpsScheme(url) {
|
|
|
+ if (typeof url === "string") {
|
|
|
+ return url.startsWith("https:");
|
|
|
+ }
|
|
|
+ return url.protocol === "https:";
|
|
|
+ }
|
|
|
++ __name(urlHasHttpsScheme, "urlHasHttpsScheme");
|
|
|
+ function urlIsHttpHttpsScheme(url) {
|
|
|
+ assert("protocol" in url);
|
|
|
+ const protocol = url.protocol;
|
|
|
+ return protocol === "http:" || protocol === "https:";
|
|
|
+ }
|
|
|
++ __name(urlIsHttpHttpsScheme, "urlIsHttpHttpsScheme");
|
|
|
+ var hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key));
|
|
|
+ module2.exports = {
|
|
|
+ isAborted,
|
|
|
+@@ -1428,10 +1566,10 @@ var require_webidl = __commonJS({
|
|
|
+ webidl.converters = {};
|
|
|
+ webidl.util = {};
|
|
|
+ webidl.errors = {};
|
|
|
+- webidl.errors.exception = function(message) {
|
|
|
++ webidl.errors.exception = function (message) {
|
|
|
+ return new TypeError(`${message.header}: ${message.message}`);
|
|
|
+ };
|
|
|
+- webidl.errors.conversionFailed = function(context) {
|
|
|
++ webidl.errors.conversionFailed = function (context) {
|
|
|
+ const plural = context.types.length === 1 ? "" : " one of";
|
|
|
+ const message = `${context.argument} could not be converted to${plural}: ${context.types.join(", ")}.`;
|
|
|
+ return webidl.errors.exception({
|
|
|
+@@ -1439,20 +1577,20 @@ var require_webidl = __commonJS({
|
|
|
+ message
|
|
|
+ });
|
|
|
+ };
|
|
|
+- webidl.errors.invalidArgument = function(context) {
|
|
|
++ webidl.errors.invalidArgument = function (context) {
|
|
|
+ return webidl.errors.exception({
|
|
|
+ header: context.prefix,
|
|
|
+ message: `"${context.value}" is an invalid ${context.type}.`
|
|
|
+ });
|
|
|
+ };
|
|
|
+- webidl.brandCheck = function(V, I, opts = void 0) {
|
|
|
++ webidl.brandCheck = function (V, I, opts = void 0) {
|
|
|
+ if (opts?.strict !== false && !(V instanceof I)) {
|
|
|
+ throw new TypeError("Illegal invocation");
|
|
|
+ } else {
|
|
|
+ return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag];
|
|
|
+ }
|
|
|
+ };
|
|
|
+- webidl.argumentLengthCheck = function({ length }, min, ctx) {
|
|
|
++ webidl.argumentLengthCheck = function ({ length }, min, ctx) {
|
|
|
+ if (length < min) {
|
|
|
+ throw webidl.errors.exception({
|
|
|
+ message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`,
|
|
|
+@@ -1460,13 +1598,13 @@ var require_webidl = __commonJS({
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+- webidl.illegalConstructor = function() {
|
|
|
++ webidl.illegalConstructor = function () {
|
|
|
+ throw webidl.errors.exception({
|
|
|
+ header: "TypeError",
|
|
|
+ message: "Illegal constructor"
|
|
|
+ });
|
|
|
+ };
|
|
|
+- webidl.util.Type = function(V) {
|
|
|
++ webidl.util.Type = function (V) {
|
|
|
+ switch (typeof V) {
|
|
|
+ case "undefined":
|
|
|
+ return "Undefined";
|
|
|
+@@ -1489,7 +1627,7 @@ var require_webidl = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+- webidl.util.ConvertToInt = function(V, bitLength, signedness, opts = {}) {
|
|
|
++ webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
|
|
|
+ let upperBound;
|
|
|
+ let lowerBound;
|
|
|
+ if (bitLength === 64) {
|
|
|
+@@ -1545,14 +1683,14 @@ var require_webidl = __commonJS({
|
|
|
+ }
|
|
|
+ return x;
|
|
|
+ };
|
|
|
+- webidl.util.IntegerPart = function(n) {
|
|
|
++ webidl.util.IntegerPart = function (n) {
|
|
|
+ const r = Math.floor(Math.abs(n));
|
|
|
+ if (n < 0) {
|
|
|
+ return -1 * r;
|
|
|
+ }
|
|
|
+ return r;
|
|
|
+ };
|
|
|
+- webidl.sequenceConverter = function(converter) {
|
|
|
++ webidl.sequenceConverter = function (converter) {
|
|
|
+ return (V) => {
|
|
|
+ if (webidl.util.Type(V) !== "Object") {
|
|
|
+ throw webidl.errors.exception({
|
|
|
+@@ -1578,7 +1716,7 @@ var require_webidl = __commonJS({
|
|
|
+ return seq;
|
|
|
+ };
|
|
|
+ };
|
|
|
+- webidl.recordConverter = function(keyConverter, valueConverter) {
|
|
|
++ webidl.recordConverter = function (keyConverter, valueConverter) {
|
|
|
+ return (O) => {
|
|
|
+ if (webidl.util.Type(O) !== "Object") {
|
|
|
+ throw webidl.errors.exception({
|
|
|
+@@ -1608,7 +1746,7 @@ var require_webidl = __commonJS({
|
|
|
+ return result;
|
|
|
+ };
|
|
|
+ };
|
|
|
+- webidl.interfaceConverter = function(i) {
|
|
|
++ webidl.interfaceConverter = function (i) {
|
|
|
+ return (V, opts = {}) => {
|
|
|
+ if (opts.strict !== false && !(V instanceof i)) {
|
|
|
+ throw webidl.errors.exception({
|
|
|
+@@ -1619,7 +1757,7 @@ var require_webidl = __commonJS({
|
|
|
+ return V;
|
|
|
+ };
|
|
|
+ };
|
|
|
+- webidl.dictionaryConverter = function(converters) {
|
|
|
++ webidl.dictionaryConverter = function (converters) {
|
|
|
+ return (dictionary) => {
|
|
|
+ const type = webidl.util.Type(dictionary);
|
|
|
+ const dict = {};
|
|
|
+@@ -1660,7 +1798,7 @@ var require_webidl = __commonJS({
|
|
|
+ return dict;
|
|
|
+ };
|
|
|
+ };
|
|
|
+- webidl.nullableConverter = function(converter) {
|
|
|
++ webidl.nullableConverter = function (converter) {
|
|
|
+ return (V) => {
|
|
|
+ if (V === null) {
|
|
|
+ return V;
|
|
|
+@@ -1668,7 +1806,7 @@ var require_webidl = __commonJS({
|
|
|
+ return converter(V);
|
|
|
+ };
|
|
|
+ };
|
|
|
+- webidl.converters.DOMString = function(V, opts = {}) {
|
|
|
++ webidl.converters.DOMString = function (V, opts = {}) {
|
|
|
+ if (V === null && opts.legacyNullToEmptyString) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+@@ -1677,7 +1815,7 @@ var require_webidl = __commonJS({
|
|
|
+ }
|
|
|
+ return String(V);
|
|
|
+ };
|
|
|
+- webidl.converters.ByteString = function(V) {
|
|
|
++ webidl.converters.ByteString = function (V) {
|
|
|
+ const x = webidl.converters.DOMString(V);
|
|
|
+ for (let index = 0; index < x.length; index++) {
|
|
|
+ const charCode = x.charCodeAt(index);
|
|
|
+@@ -1690,30 +1828,30 @@ var require_webidl = __commonJS({
|
|
|
+ return x;
|
|
|
+ };
|
|
|
+ webidl.converters.USVString = toUSVString;
|
|
|
+- webidl.converters.boolean = function(V) {
|
|
|
++ webidl.converters.boolean = function (V) {
|
|
|
+ const x = Boolean(V);
|
|
|
+ return x;
|
|
|
+ };
|
|
|
+- webidl.converters.any = function(V) {
|
|
|
++ webidl.converters.any = function (V) {
|
|
|
+ return V;
|
|
|
+ };
|
|
|
+- webidl.converters["long long"] = function(V) {
|
|
|
++ webidl.converters["long long"] = function (V) {
|
|
|
+ const x = webidl.util.ConvertToInt(V, 64, "signed");
|
|
|
+ return x;
|
|
|
+ };
|
|
|
+- webidl.converters["unsigned long long"] = function(V) {
|
|
|
++ webidl.converters["unsigned long long"] = function (V) {
|
|
|
+ const x = webidl.util.ConvertToInt(V, 64, "unsigned");
|
|
|
+ return x;
|
|
|
+ };
|
|
|
+- webidl.converters["unsigned long"] = function(V) {
|
|
|
++ webidl.converters["unsigned long"] = function (V) {
|
|
|
+ const x = webidl.util.ConvertToInt(V, 32, "unsigned");
|
|
|
+ return x;
|
|
|
+ };
|
|
|
+- webidl.converters["unsigned short"] = function(V, opts) {
|
|
|
++ webidl.converters["unsigned short"] = function (V, opts) {
|
|
|
+ const x = webidl.util.ConvertToInt(V, 16, "unsigned", opts);
|
|
|
+ return x;
|
|
|
+ };
|
|
|
+- webidl.converters.ArrayBuffer = function(V, opts = {}) {
|
|
|
++ webidl.converters.ArrayBuffer = function (V, opts = {}) {
|
|
|
+ if (webidl.util.Type(V) !== "Object" || !types.isAnyArrayBuffer(V)) {
|
|
|
+ throw webidl.errors.conversionFailed({
|
|
|
+ prefix: `${V}`,
|
|
|
+@@ -1729,7 +1867,7 @@ var require_webidl = __commonJS({
|
|
|
+ }
|
|
|
+ return V;
|
|
|
+ };
|
|
|
+- webidl.converters.TypedArray = function(V, T, opts = {}) {
|
|
|
++ webidl.converters.TypedArray = function (V, T, opts = {}) {
|
|
|
+ if (webidl.util.Type(V) !== "Object" || !types.isTypedArray(V) || V.constructor.name !== T.name) {
|
|
|
+ throw webidl.errors.conversionFailed({
|
|
|
+ prefix: `${T.name}`,
|
|
|
+@@ -1745,7 +1883,7 @@ var require_webidl = __commonJS({
|
|
|
+ }
|
|
|
+ return V;
|
|
|
+ };
|
|
|
+- webidl.converters.DataView = function(V, opts = {}) {
|
|
|
++ webidl.converters.DataView = function (V, opts = {}) {
|
|
|
+ if (webidl.util.Type(V) !== "Object" || !types.isDataView(V)) {
|
|
|
+ throw webidl.errors.exception({
|
|
|
+ header: "DataView",
|
|
|
+@@ -1760,7 +1898,7 @@ var require_webidl = __commonJS({
|
|
|
+ }
|
|
|
+ return V;
|
|
|
+ };
|
|
|
+- webidl.converters.BufferSource = function(V, opts = {}) {
|
|
|
++ webidl.converters.BufferSource = function (V, opts = {}) {
|
|
|
+ if (types.isAnyArrayBuffer(V)) {
|
|
|
+ return webidl.converters.ArrayBuffer(V, opts);
|
|
|
+ }
|
|
|
+@@ -1810,6 +1948,7 @@ var require_headers = __commonJS({
|
|
|
+ ;
|
|
|
+ return potentialValue.slice(0, i + 1).replace(/^[\r\n\t ]+/, "");
|
|
|
+ }
|
|
|
++ __name(headerValueNormalize, "headerValueNormalize");
|
|
|
+ function fill(headers, object) {
|
|
|
+ if (Array.isArray(object)) {
|
|
|
+ for (const header of object) {
|
|
|
+@@ -1833,7 +1972,11 @@ var require_headers = __commonJS({
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(fill, "fill");
|
|
|
+ var HeadersList = class _HeadersList {
|
|
|
++ static {
|
|
|
++ __name(this, "HeadersList");
|
|
|
++ }
|
|
|
+ /** @type {[string, string][]|null} */
|
|
|
+ cookies = null;
|
|
|
+ constructor(init) {
|
|
|
+@@ -1916,6 +2059,9 @@ var require_headers = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var Headers = class _Headers {
|
|
|
++ static {
|
|
|
++ __name(this, "Headers");
|
|
|
++ }
|
|
|
+ constructor(init = void 0) {
|
|
|
+ this[kHeadersList] = new HeadersList();
|
|
|
+ this[kGuard] = "none";
|
|
|
+@@ -2118,7 +2264,7 @@ var require_headers = __commonJS({
|
|
|
+ configurable: true
|
|
|
+ }
|
|
|
+ });
|
|
|
+- webidl.converters.HeadersInit = function(V) {
|
|
|
++ webidl.converters.HeadersInit = function (V) {
|
|
|
+ if (webidl.util.Type(V) === "Object") {
|
|
|
+ if (V[Symbol.iterator]) {
|
|
|
+ return webidl.converters["sequence<sequence<ByteString>>"](V);
|
|
|
+@@ -2170,13 +2316,14 @@ var require_sbmh = __commonJS({
|
|
|
+ this._occ[needle[i]] = needleLength - 1 - i;
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(SBMH, "SBMH");
|
|
|
+ inherits(SBMH, EventEmitter);
|
|
|
+- SBMH.prototype.reset = function() {
|
|
|
++ SBMH.prototype.reset = function () {
|
|
|
+ this._lookbehind_size = 0;
|
|
|
+ this.matches = 0;
|
|
|
+ this._bufpos = 0;
|
|
|
+ };
|
|
|
+- SBMH.prototype.push = function(chunk, pos) {
|
|
|
++ SBMH.prototype.push = function (chunk, pos) {
|
|
|
+ if (!Buffer.isBuffer(chunk)) {
|
|
|
+ chunk = Buffer.from(chunk, "binary");
|
|
|
+ }
|
|
|
+@@ -2188,7 +2335,7 @@ var require_sbmh = __commonJS({
|
|
|
+ }
|
|
|
+ return r;
|
|
|
+ };
|
|
|
+- SBMH.prototype._sbmh_feed = function(data) {
|
|
|
++ SBMH.prototype._sbmh_feed = function (data) {
|
|
|
+ const len = data.length;
|
|
|
+ const needle = this._needle;
|
|
|
+ const needleLength = needle.length;
|
|
|
+@@ -2261,10 +2408,10 @@ var require_sbmh = __commonJS({
|
|
|
+ this._bufpos = len;
|
|
|
+ return len;
|
|
|
+ };
|
|
|
+- SBMH.prototype._sbmh_lookup_char = function(data, pos) {
|
|
|
++ SBMH.prototype._sbmh_lookup_char = function (data, pos) {
|
|
|
+ return pos < 0 ? this._lookbehind[this._lookbehind_size + pos] : data[pos];
|
|
|
+ };
|
|
|
+- SBMH.prototype._sbmh_memcmp = function(data, pos, len) {
|
|
|
++ SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
|
|
|
+ for (var i = 0; i < len; ++i) {
|
|
|
+ if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) {
|
|
|
+ return false;
|
|
|
+@@ -2285,8 +2432,9 @@ var require_PartStream = __commonJS({
|
|
|
+ function PartStream(opts) {
|
|
|
+ ReadableStream.call(this, opts);
|
|
|
+ }
|
|
|
++ __name(PartStream, "PartStream");
|
|
|
+ inherits(PartStream, ReadableStream);
|
|
|
+- PartStream.prototype._read = function(n) {
|
|
|
++ PartStream.prototype._read = function (n) {
|
|
|
+ };
|
|
|
+ module2.exports = PartStream;
|
|
|
+ }
|
|
|
+@@ -2296,7 +2444,7 @@ var require_PartStream = __commonJS({
|
|
|
+ var require_getLimit = __commonJS({
|
|
|
+ "node_modules/@fastify/busboy/lib/utils/getLimit.js"(exports2, module2) {
|
|
|
+ "use strict";
|
|
|
+- module2.exports = function getLimit(limits, name, defaultLimit) {
|
|
|
++ module2.exports = /* @__PURE__ */ __name(function getLimit(limits, name, defaultLimit) {
|
|
|
+ if (!limits || limits[name] === void 0 || limits[name] === null) {
|
|
|
+ return defaultLimit;
|
|
|
+ }
|
|
|
+@@ -2304,7 +2452,7 @@ var require_getLimit = __commonJS({
|
|
|
+ throw new TypeError("Limit " + name + " is not a valid number");
|
|
|
+ }
|
|
|
+ return limits[name];
|
|
|
+- };
|
|
|
++ }, "getLimit");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+@@ -2332,7 +2480,7 @@ var require_HeaderParser = __commonJS({
|
|
|
+ this.header = {};
|
|
|
+ this.finished = false;
|
|
|
+ this.ss = new StreamSearch(B_DCRLF);
|
|
|
+- this.ss.on("info", function(isMatch, data, start, end) {
|
|
|
++ this.ss.on("info", function (isMatch, data, start, end) {
|
|
|
+ if (data && !self.maxed) {
|
|
|
+ if (self.nread + end - start >= self.maxHeaderSize) {
|
|
|
+ end = self.maxHeaderSize - self.nread + start;
|
|
|
+@@ -2348,20 +2496,21 @@ var require_HeaderParser = __commonJS({
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
++ __name(HeaderParser, "HeaderParser");
|
|
|
+ inherits(HeaderParser, EventEmitter);
|
|
|
+- HeaderParser.prototype.push = function(data) {
|
|
|
++ HeaderParser.prototype.push = function (data) {
|
|
|
+ const r = this.ss.push(data);
|
|
|
+ if (this.finished) {
|
|
|
+ return r;
|
|
|
+ }
|
|
|
+ };
|
|
|
+- HeaderParser.prototype.reset = function() {
|
|
|
++ HeaderParser.prototype.reset = function () {
|
|
|
+ this.finished = false;
|
|
|
+ this.buffer = "";
|
|
|
+ this.header = {};
|
|
|
+ this.ss.reset();
|
|
|
+ };
|
|
|
+- HeaderParser.prototype._finish = function() {
|
|
|
++ HeaderParser.prototype._finish = function () {
|
|
|
+ if (this.buffer) {
|
|
|
+ this._parseHeader();
|
|
|
+ }
|
|
|
+@@ -2374,7 +2523,7 @@ var require_HeaderParser = __commonJS({
|
|
|
+ this.maxed = false;
|
|
|
+ this.emit("header", header);
|
|
|
+ };
|
|
|
+- HeaderParser.prototype._parseHeader = function() {
|
|
|
++ HeaderParser.prototype._parseHeader = function () {
|
|
|
+ if (this.npairs === this.maxHeaderPairs) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+@@ -2420,8 +2569,8 @@ var require_Dicer = __commonJS({
|
|
|
+ var DASH = 45;
|
|
|
+ var B_ONEDASH = Buffer.from("-");
|
|
|
+ var B_CRLF = Buffer.from("\r\n");
|
|
|
+- var EMPTY_FN = function() {
|
|
|
+- };
|
|
|
++ var EMPTY_FN = /* @__PURE__ */ __name(function () {
|
|
|
++ }, "EMPTY_FN");
|
|
|
+ function Dicer(cfg) {
|
|
|
+ if (!(this instanceof Dicer)) {
|
|
|
+ return new Dicer(cfg);
|
|
|
+@@ -2451,23 +2600,24 @@ var require_Dicer = __commonJS({
|
|
|
+ this._pause = false;
|
|
|
+ const self = this;
|
|
|
+ this._hparser = new HeaderParser(cfg);
|
|
|
+- this._hparser.on("header", function(header) {
|
|
|
++ this._hparser.on("header", function (header) {
|
|
|
+ self._inHeader = false;
|
|
|
+ self._part.emit("header", header);
|
|
|
+ });
|
|
|
+ }
|
|
|
++ __name(Dicer, "Dicer");
|
|
|
+ inherits(Dicer, WritableStream);
|
|
|
+- Dicer.prototype.emit = function(ev) {
|
|
|
++ Dicer.prototype.emit = function (ev) {
|
|
|
+ if (ev === "finish" && !this._realFinish) {
|
|
|
+ if (!this._finished) {
|
|
|
+ const self = this;
|
|
|
+- process.nextTick(function() {
|
|
|
++ process.nextTick(function () {
|
|
|
+ self.emit("error", new Error("Unexpected end of multipart data"));
|
|
|
+ if (self._part && !self._ignoreData) {
|
|
|
+ const type = self._isPreamble ? "Preamble" : "Part";
|
|
|
+ self._part.emit("error", new Error(type + " terminated early due to unexpected end of multipart data"));
|
|
|
+ self._part.push(null);
|
|
|
+- process.nextTick(function() {
|
|
|
++ process.nextTick(function () {
|
|
|
+ self._realFinish = true;
|
|
|
+ self.emit("finish");
|
|
|
+ self._realFinish = false;
|
|
|
+@@ -2483,7 +2633,7 @@ var require_Dicer = __commonJS({
|
|
|
+ WritableStream.prototype.emit.apply(this, arguments);
|
|
|
+ }
|
|
|
+ };
|
|
|
+- Dicer.prototype._write = function(data, encoding, cb) {
|
|
|
++ Dicer.prototype._write = function (data, encoding, cb) {
|
|
|
+ if (!this._hparser && !this._bparser) {
|
|
|
+ return cb();
|
|
|
+ }
|
|
|
+@@ -2514,26 +2664,26 @@ var require_Dicer = __commonJS({
|
|
|
+ cb();
|
|
|
+ }
|
|
|
+ };
|
|
|
+- Dicer.prototype.reset = function() {
|
|
|
++ Dicer.prototype.reset = function () {
|
|
|
+ this._part = void 0;
|
|
|
+ this._bparser = void 0;
|
|
|
+ this._hparser = void 0;
|
|
|
+ };
|
|
|
+- Dicer.prototype.setBoundary = function(boundary) {
|
|
|
++ Dicer.prototype.setBoundary = function (boundary) {
|
|
|
+ const self = this;
|
|
|
+ this._bparser = new StreamSearch("\r\n--" + boundary);
|
|
|
+- this._bparser.on("info", function(isMatch, data, start, end) {
|
|
|
++ this._bparser.on("info", function (isMatch, data, start, end) {
|
|
|
+ self._oninfo(isMatch, data, start, end);
|
|
|
+ });
|
|
|
+ };
|
|
|
+- Dicer.prototype._ignore = function() {
|
|
|
++ Dicer.prototype._ignore = function () {
|
|
|
+ if (this._part && !this._ignoreData) {
|
|
|
+ this._ignoreData = true;
|
|
|
+ this._part.on("error", EMPTY_FN);
|
|
|
+ this._part.resume();
|
|
|
+ }
|
|
|
+ };
|
|
|
+- Dicer.prototype._oninfo = function(isMatch, data, start, end) {
|
|
|
++ Dicer.prototype._oninfo = function (isMatch, data, start, end) {
|
|
|
+ let buf;
|
|
|
+ const self = this;
|
|
|
+ let i = 0;
|
|
|
+@@ -2573,7 +2723,7 @@ var require_Dicer = __commonJS({
|
|
|
+ }
|
|
|
+ if (!this._part) {
|
|
|
+ this._part = new PartStream(this._partOpts);
|
|
|
+- this._part._read = function(n) {
|
|
|
++ this._part._read = function (n) {
|
|
|
+ self._unpause();
|
|
|
+ };
|
|
|
+ if (this._isPreamble && this._events.preamble) {
|
|
|
+@@ -2613,7 +2763,7 @@ var require_Dicer = __commonJS({
|
|
|
+ } else {
|
|
|
+ if (start !== end) {
|
|
|
+ ++this._parts;
|
|
|
+- this._part.on("end", function() {
|
|
|
++ this._part.on("end", function () {
|
|
|
+ if (--self._parts === 0) {
|
|
|
+ if (self._finished) {
|
|
|
+ self._realFinish = true;
|
|
|
+@@ -2633,7 +2783,7 @@ var require_Dicer = __commonJS({
|
|
|
+ this._dashes = 0;
|
|
|
+ }
|
|
|
+ };
|
|
|
+- Dicer.prototype._unpause = function() {
|
|
|
++ Dicer.prototype._unpause = function () {
|
|
|
+ if (!this._pause) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+@@ -2657,23 +2807,103 @@ var require_decodeText = __commonJS({
|
|
|
+ ["utf-8", utf8Decoder],
|
|
|
+ ["utf8", utf8Decoder]
|
|
|
+ ]);
|
|
|
+- function decodeText(text, textEncoding, destEncoding) {
|
|
|
+- if (text) {
|
|
|
+- if (textDecoders.has(destEncoding)) {
|
|
|
+- try {
|
|
|
+- return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding));
|
|
|
+- } catch (e) {
|
|
|
+- }
|
|
|
+- } else {
|
|
|
++ function getDecoder(charset) {
|
|
|
++ let lc;
|
|
|
++ while (true) {
|
|
|
++ switch (charset) {
|
|
|
++ case "utf-8":
|
|
|
++ case "utf8":
|
|
|
++ return decoders.utf8;
|
|
|
++ case "latin1":
|
|
|
++ case "ascii":
|
|
|
++ case "us-ascii":
|
|
|
++ case "iso-8859-1":
|
|
|
++ case "iso8859-1":
|
|
|
++ case "iso88591":
|
|
|
++ case "iso_8859-1":
|
|
|
++ case "windows-1252":
|
|
|
++ case "iso_8859-1:1987":
|
|
|
++ case "cp1252":
|
|
|
++ case "x-cp1252":
|
|
|
++ return decoders.latin1;
|
|
|
++ case "utf16le":
|
|
|
++ case "utf-16le":
|
|
|
++ case "ucs2":
|
|
|
++ case "ucs-2":
|
|
|
++ return decoders.utf16le;
|
|
|
++ case "base64":
|
|
|
++ return decoders.base64;
|
|
|
++ default:
|
|
|
++ if (lc === void 0) {
|
|
|
++ lc = true;
|
|
|
++ charset = charset.toLowerCase();
|
|
|
++ continue;
|
|
|
++ }
|
|
|
++ return decoders.other.bind(charset);
|
|
|
++ }
|
|
|
++ }
|
|
|
++ }
|
|
|
++ __name(getDecoder, "getDecoder");
|
|
|
++ var decoders = {
|
|
|
++ utf8: (data, sourceEncoding) => {
|
|
|
++ if (data.length === 0) {
|
|
|
++ return "";
|
|
|
++ }
|
|
|
++ if (typeof data === "string") {
|
|
|
++ data = Buffer.from(data, sourceEncoding);
|
|
|
++ }
|
|
|
++ return data.utf8Slice(0, data.length);
|
|
|
++ },
|
|
|
++ latin1: (data, sourceEncoding) => {
|
|
|
++ if (data.length === 0) {
|
|
|
++ return "";
|
|
|
++ }
|
|
|
++ if (typeof data === "string") {
|
|
|
++ return data;
|
|
|
++ }
|
|
|
++ return data.latin1Slice(0, data.length);
|
|
|
++ },
|
|
|
++ utf16le: (data, sourceEncoding) => {
|
|
|
++ if (data.length === 0) {
|
|
|
++ return "";
|
|
|
++ }
|
|
|
++ if (typeof data === "string") {
|
|
|
++ data = Buffer.from(data, sourceEncoding);
|
|
|
++ }
|
|
|
++ return data.ucs2Slice(0, data.length);
|
|
|
++ },
|
|
|
++ base64: (data, sourceEncoding) => {
|
|
|
++ if (data.length === 0) {
|
|
|
++ return "";
|
|
|
++ }
|
|
|
++ if (typeof data === "string") {
|
|
|
++ data = Buffer.from(data, sourceEncoding);
|
|
|
++ }
|
|
|
++ return data.base64Slice(0, data.length);
|
|
|
++ },
|
|
|
++ other: (data, sourceEncoding) => {
|
|
|
++ if (data.length === 0) {
|
|
|
++ return "";
|
|
|
++ }
|
|
|
++ if (typeof data === "string") {
|
|
|
++ data = Buffer.from(data, sourceEncoding);
|
|
|
++ }
|
|
|
++ if (textDecoders.has(exports2.toString())) {
|
|
|
+ try {
|
|
|
+- textDecoders.set(destEncoding, new TextDecoder(destEncoding));
|
|
|
+- return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding));
|
|
|
++ return textDecoders.get(exports2).decode(data);
|
|
|
+ } catch (e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
++ return typeof data === "string" ? data : data.toString();
|
|
|
++ }
|
|
|
++ };
|
|
|
++ function decodeText(text, sourceEncoding, destEncoding) {
|
|
|
++ if (text) {
|
|
|
++ return getDecoder(destEncoding)(text, sourceEncoding);
|
|
|
+ }
|
|
|
+ return text;
|
|
|
+ }
|
|
|
++ __name(decodeText, "decodeText");
|
|
|
+ module2.exports = decodeText;
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -2683,19 +2913,511 @@ var require_parseParams = __commonJS({
|
|
|
+ "node_modules/@fastify/busboy/lib/utils/parseParams.js"(exports2, module2) {
|
|
|
+ "use strict";
|
|
|
+ var decodeText = require_decodeText();
|
|
|
+- var RE_ENCODED = /%([a-fA-F0-9]{2})/g;
|
|
|
+- function encodedReplacer(match, byte) {
|
|
|
+- return String.fromCharCode(parseInt(byte, 16));
|
|
|
+- }
|
|
|
++ var RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g;
|
|
|
++ var EncodedLookup = {
|
|
|
++ "%00": "\0",
|
|
|
++ "%01": "",
|
|
|
++ "%02": "",
|
|
|
++ "%03": "",
|
|
|
++ "%04": "",
|
|
|
++ "%05": "",
|
|
|
++ "%06": "",
|
|
|
++ "%07": "\x07",
|
|
|
++ "%08": "\b",
|
|
|
++ "%09": " ",
|
|
|
++ "%0a": "\n",
|
|
|
++ "%0A": "\n",
|
|
|
++ "%0b": "\v",
|
|
|
++ "%0B": "\v",
|
|
|
++ "%0c": "\f",
|
|
|
++ "%0C": "\f",
|
|
|
++ "%0d": "\r",
|
|
|
++ "%0D": "\r",
|
|
|
++ "%0e": "",
|
|
|
++ "%0E": "",
|
|
|
++ "%0f": "",
|
|
|
++ "%0F": "",
|
|
|
++ "%10": "",
|
|
|
++ "%11": "",
|
|
|
++ "%12": "",
|
|
|
++ "%13": "",
|
|
|
++ "%14": "",
|
|
|
++ "%15": "",
|
|
|
++ "%16": "",
|
|
|
++ "%17": "",
|
|
|
++ "%18": "",
|
|
|
++ "%19": "",
|
|
|
++ "%1a": "",
|
|
|
++ "%1A": "",
|
|
|
++ "%1b": "\x1B",
|
|
|
++ "%1B": "\x1B",
|
|
|
++ "%1c": "",
|
|
|
++ "%1C": "",
|
|
|
++ "%1d": "",
|
|
|
++ "%1D": "",
|
|
|
++ "%1e": "",
|
|
|
++ "%1E": "",
|
|
|
++ "%1f": "",
|
|
|
++ "%1F": "",
|
|
|
++ "%20": " ",
|
|
|
++ "%21": "!",
|
|
|
++ "%22": '"',
|
|
|
++ "%23": "#",
|
|
|
++ "%24": "$",
|
|
|
++ "%25": "%",
|
|
|
++ "%26": "&",
|
|
|
++ "%27": "'",
|
|
|
++ "%28": "(",
|
|
|
++ "%29": ")",
|
|
|
++ "%2a": "*",
|
|
|
++ "%2A": "*",
|
|
|
++ "%2b": "+",
|
|
|
++ "%2B": "+",
|
|
|
++ "%2c": ",",
|
|
|
++ "%2C": ",",
|
|
|
++ "%2d": "-",
|
|
|
++ "%2D": "-",
|
|
|
++ "%2e": ".",
|
|
|
++ "%2E": ".",
|
|
|
++ "%2f": "/",
|
|
|
++ "%2F": "/",
|
|
|
++ "%30": "0",
|
|
|
++ "%31": "1",
|
|
|
++ "%32": "2",
|
|
|
++ "%33": "3",
|
|
|
++ "%34": "4",
|
|
|
++ "%35": "5",
|
|
|
++ "%36": "6",
|
|
|
++ "%37": "7",
|
|
|
++ "%38": "8",
|
|
|
++ "%39": "9",
|
|
|
++ "%3a": ":",
|
|
|
++ "%3A": ":",
|
|
|
++ "%3b": ";",
|
|
|
++ "%3B": ";",
|
|
|
++ "%3c": "<",
|
|
|
++ "%3C": "<",
|
|
|
++ "%3d": "=",
|
|
|
++ "%3D": "=",
|
|
|
++ "%3e": ">",
|
|
|
++ "%3E": ">",
|
|
|
++ "%3f": "?",
|
|
|
++ "%3F": "?",
|
|
|
++ "%40": "@",
|
|
|
++ "%41": "A",
|
|
|
++ "%42": "B",
|
|
|
++ "%43": "C",
|
|
|
++ "%44": "D",
|
|
|
++ "%45": "E",
|
|
|
++ "%46": "F",
|
|
|
++ "%47": "G",
|
|
|
++ "%48": "H",
|
|
|
++ "%49": "I",
|
|
|
++ "%4a": "J",
|
|
|
++ "%4A": "J",
|
|
|
++ "%4b": "K",
|
|
|
++ "%4B": "K",
|
|
|
++ "%4c": "L",
|
|
|
++ "%4C": "L",
|
|
|
++ "%4d": "M",
|
|
|
++ "%4D": "M",
|
|
|
++ "%4e": "N",
|
|
|
++ "%4E": "N",
|
|
|
++ "%4f": "O",
|
|
|
++ "%4F": "O",
|
|
|
++ "%50": "P",
|
|
|
++ "%51": "Q",
|
|
|
++ "%52": "R",
|
|
|
++ "%53": "S",
|
|
|
++ "%54": "T",
|
|
|
++ "%55": "U",
|
|
|
++ "%56": "V",
|
|
|
++ "%57": "W",
|
|
|
++ "%58": "X",
|
|
|
++ "%59": "Y",
|
|
|
++ "%5a": "Z",
|
|
|
++ "%5A": "Z",
|
|
|
++ "%5b": "[",
|
|
|
++ "%5B": "[",
|
|
|
++ "%5c": "\\",
|
|
|
++ "%5C": "\\",
|
|
|
++ "%5d": "]",
|
|
|
++ "%5D": "]",
|
|
|
++ "%5e": "^",
|
|
|
++ "%5E": "^",
|
|
|
++ "%5f": "_",
|
|
|
++ "%5F": "_",
|
|
|
++ "%60": "`",
|
|
|
++ "%61": "a",
|
|
|
++ "%62": "b",
|
|
|
++ "%63": "c",
|
|
|
++ "%64": "d",
|
|
|
++ "%65": "e",
|
|
|
++ "%66": "f",
|
|
|
++ "%67": "g",
|
|
|
++ "%68": "h",
|
|
|
++ "%69": "i",
|
|
|
++ "%6a": "j",
|
|
|
++ "%6A": "j",
|
|
|
++ "%6b": "k",
|
|
|
++ "%6B": "k",
|
|
|
++ "%6c": "l",
|
|
|
++ "%6C": "l",
|
|
|
++ "%6d": "m",
|
|
|
++ "%6D": "m",
|
|
|
++ "%6e": "n",
|
|
|
++ "%6E": "n",
|
|
|
++ "%6f": "o",
|
|
|
++ "%6F": "o",
|
|
|
++ "%70": "p",
|
|
|
++ "%71": "q",
|
|
|
++ "%72": "r",
|
|
|
++ "%73": "s",
|
|
|
++ "%74": "t",
|
|
|
++ "%75": "u",
|
|
|
++ "%76": "v",
|
|
|
++ "%77": "w",
|
|
|
++ "%78": "x",
|
|
|
++ "%79": "y",
|
|
|
++ "%7a": "z",
|
|
|
++ "%7A": "z",
|
|
|
++ "%7b": "{",
|
|
|
++ "%7B": "{",
|
|
|
++ "%7c": "|",
|
|
|
++ "%7C": "|",
|
|
|
++ "%7d": "}",
|
|
|
++ "%7D": "}",
|
|
|
++ "%7e": "~",
|
|
|
++ "%7E": "~",
|
|
|
++ "%7f": "\x7F",
|
|
|
++ "%7F": "\x7F",
|
|
|
++ "%80": "\x80",
|
|
|
++ "%81": "\x81",
|
|
|
++ "%82": "\x82",
|
|
|
++ "%83": "\x83",
|
|
|
++ "%84": "\x84",
|
|
|
++ "%85": "\x85",
|
|
|
++ "%86": "\x86",
|
|
|
++ "%87": "\x87",
|
|
|
++ "%88": "\x88",
|
|
|
++ "%89": "\x89",
|
|
|
++ "%8a": "\x8A",
|
|
|
++ "%8A": "\x8A",
|
|
|
++ "%8b": "\x8B",
|
|
|
++ "%8B": "\x8B",
|
|
|
++ "%8c": "\x8C",
|
|
|
++ "%8C": "\x8C",
|
|
|
++ "%8d": "\x8D",
|
|
|
++ "%8D": "\x8D",
|
|
|
++ "%8e": "\x8E",
|
|
|
++ "%8E": "\x8E",
|
|
|
++ "%8f": "\x8F",
|
|
|
++ "%8F": "\x8F",
|
|
|
++ "%90": "\x90",
|
|
|
++ "%91": "\x91",
|
|
|
++ "%92": "\x92",
|
|
|
++ "%93": "\x93",
|
|
|
++ "%94": "\x94",
|
|
|
++ "%95": "\x95",
|
|
|
++ "%96": "\x96",
|
|
|
++ "%97": "\x97",
|
|
|
++ "%98": "\x98",
|
|
|
++ "%99": "\x99",
|
|
|
++ "%9a": "\x9A",
|
|
|
++ "%9A": "\x9A",
|
|
|
++ "%9b": "\x9B",
|
|
|
++ "%9B": "\x9B",
|
|
|
++ "%9c": "\x9C",
|
|
|
++ "%9C": "\x9C",
|
|
|
++ "%9d": "\x9D",
|
|
|
++ "%9D": "\x9D",
|
|
|
++ "%9e": "\x9E",
|
|
|
++ "%9E": "\x9E",
|
|
|
++ "%9f": "\x9F",
|
|
|
++ "%9F": "\x9F",
|
|
|
++ "%a0": "\xA0",
|
|
|
++ "%A0": "\xA0",
|
|
|
++ "%a1": "\xA1",
|
|
|
++ "%A1": "\xA1",
|
|
|
++ "%a2": "\xA2",
|
|
|
++ "%A2": "\xA2",
|
|
|
++ "%a3": "\xA3",
|
|
|
++ "%A3": "\xA3",
|
|
|
++ "%a4": "\xA4",
|
|
|
++ "%A4": "\xA4",
|
|
|
++ "%a5": "\xA5",
|
|
|
++ "%A5": "\xA5",
|
|
|
++ "%a6": "\xA6",
|
|
|
++ "%A6": "\xA6",
|
|
|
++ "%a7": "\xA7",
|
|
|
++ "%A7": "\xA7",
|
|
|
++ "%a8": "\xA8",
|
|
|
++ "%A8": "\xA8",
|
|
|
++ "%a9": "\xA9",
|
|
|
++ "%A9": "\xA9",
|
|
|
++ "%aa": "\xAA",
|
|
|
++ "%Aa": "\xAA",
|
|
|
++ "%aA": "\xAA",
|
|
|
++ "%AA": "\xAA",
|
|
|
++ "%ab": "\xAB",
|
|
|
++ "%Ab": "\xAB",
|
|
|
++ "%aB": "\xAB",
|
|
|
++ "%AB": "\xAB",
|
|
|
++ "%ac": "\xAC",
|
|
|
++ "%Ac": "\xAC",
|
|
|
++ "%aC": "\xAC",
|
|
|
++ "%AC": "\xAC",
|
|
|
++ "%ad": "\xAD",
|
|
|
++ "%Ad": "\xAD",
|
|
|
++ "%aD": "\xAD",
|
|
|
++ "%AD": "\xAD",
|
|
|
++ "%ae": "\xAE",
|
|
|
++ "%Ae": "\xAE",
|
|
|
++ "%aE": "\xAE",
|
|
|
++ "%AE": "\xAE",
|
|
|
++ "%af": "\xAF",
|
|
|
++ "%Af": "\xAF",
|
|
|
++ "%aF": "\xAF",
|
|
|
++ "%AF": "\xAF",
|
|
|
++ "%b0": "\xB0",
|
|
|
++ "%B0": "\xB0",
|
|
|
++ "%b1": "\xB1",
|
|
|
++ "%B1": "\xB1",
|
|
|
++ "%b2": "\xB2",
|
|
|
++ "%B2": "\xB2",
|
|
|
++ "%b3": "\xB3",
|
|
|
++ "%B3": "\xB3",
|
|
|
++ "%b4": "\xB4",
|
|
|
++ "%B4": "\xB4",
|
|
|
++ "%b5": "\xB5",
|
|
|
++ "%B5": "\xB5",
|
|
|
++ "%b6": "\xB6",
|
|
|
++ "%B6": "\xB6",
|
|
|
++ "%b7": "\xB7",
|
|
|
++ "%B7": "\xB7",
|
|
|
++ "%b8": "\xB8",
|
|
|
++ "%B8": "\xB8",
|
|
|
++ "%b9": "\xB9",
|
|
|
++ "%B9": "\xB9",
|
|
|
++ "%ba": "\xBA",
|
|
|
++ "%Ba": "\xBA",
|
|
|
++ "%bA": "\xBA",
|
|
|
++ "%BA": "\xBA",
|
|
|
++ "%bb": "\xBB",
|
|
|
++ "%Bb": "\xBB",
|
|
|
++ "%bB": "\xBB",
|
|
|
++ "%BB": "\xBB",
|
|
|
++ "%bc": "\xBC",
|
|
|
++ "%Bc": "\xBC",
|
|
|
++ "%bC": "\xBC",
|
|
|
++ "%BC": "\xBC",
|
|
|
++ "%bd": "\xBD",
|
|
|
++ "%Bd": "\xBD",
|
|
|
++ "%bD": "\xBD",
|
|
|
++ "%BD": "\xBD",
|
|
|
++ "%be": "\xBE",
|
|
|
++ "%Be": "\xBE",
|
|
|
++ "%bE": "\xBE",
|
|
|
++ "%BE": "\xBE",
|
|
|
++ "%bf": "\xBF",
|
|
|
++ "%Bf": "\xBF",
|
|
|
++ "%bF": "\xBF",
|
|
|
++ "%BF": "\xBF",
|
|
|
++ "%c0": "\xC0",
|
|
|
++ "%C0": "\xC0",
|
|
|
++ "%c1": "\xC1",
|
|
|
++ "%C1": "\xC1",
|
|
|
++ "%c2": "\xC2",
|
|
|
++ "%C2": "\xC2",
|
|
|
++ "%c3": "\xC3",
|
|
|
++ "%C3": "\xC3",
|
|
|
++ "%c4": "\xC4",
|
|
|
++ "%C4": "\xC4",
|
|
|
++ "%c5": "\xC5",
|
|
|
++ "%C5": "\xC5",
|
|
|
++ "%c6": "\xC6",
|
|
|
++ "%C6": "\xC6",
|
|
|
++ "%c7": "\xC7",
|
|
|
++ "%C7": "\xC7",
|
|
|
++ "%c8": "\xC8",
|
|
|
++ "%C8": "\xC8",
|
|
|
++ "%c9": "\xC9",
|
|
|
++ "%C9": "\xC9",
|
|
|
++ "%ca": "\xCA",
|
|
|
++ "%Ca": "\xCA",
|
|
|
++ "%cA": "\xCA",
|
|
|
++ "%CA": "\xCA",
|
|
|
++ "%cb": "\xCB",
|
|
|
++ "%Cb": "\xCB",
|
|
|
++ "%cB": "\xCB",
|
|
|
++ "%CB": "\xCB",
|
|
|
++ "%cc": "\xCC",
|
|
|
++ "%Cc": "\xCC",
|
|
|
++ "%cC": "\xCC",
|
|
|
++ "%CC": "\xCC",
|
|
|
++ "%cd": "\xCD",
|
|
|
++ "%Cd": "\xCD",
|
|
|
++ "%cD": "\xCD",
|
|
|
++ "%CD": "\xCD",
|
|
|
++ "%ce": "\xCE",
|
|
|
++ "%Ce": "\xCE",
|
|
|
++ "%cE": "\xCE",
|
|
|
++ "%CE": "\xCE",
|
|
|
++ "%cf": "\xCF",
|
|
|
++ "%Cf": "\xCF",
|
|
|
++ "%cF": "\xCF",
|
|
|
++ "%CF": "\xCF",
|
|
|
++ "%d0": "\xD0",
|
|
|
++ "%D0": "\xD0",
|
|
|
++ "%d1": "\xD1",
|
|
|
++ "%D1": "\xD1",
|
|
|
++ "%d2": "\xD2",
|
|
|
++ "%D2": "\xD2",
|
|
|
++ "%d3": "\xD3",
|
|
|
++ "%D3": "\xD3",
|
|
|
++ "%d4": "\xD4",
|
|
|
++ "%D4": "\xD4",
|
|
|
++ "%d5": "\xD5",
|
|
|
++ "%D5": "\xD5",
|
|
|
++ "%d6": "\xD6",
|
|
|
++ "%D6": "\xD6",
|
|
|
++ "%d7": "\xD7",
|
|
|
++ "%D7": "\xD7",
|
|
|
++ "%d8": "\xD8",
|
|
|
++ "%D8": "\xD8",
|
|
|
++ "%d9": "\xD9",
|
|
|
++ "%D9": "\xD9",
|
|
|
++ "%da": "\xDA",
|
|
|
++ "%Da": "\xDA",
|
|
|
++ "%dA": "\xDA",
|
|
|
++ "%DA": "\xDA",
|
|
|
++ "%db": "\xDB",
|
|
|
++ "%Db": "\xDB",
|
|
|
++ "%dB": "\xDB",
|
|
|
++ "%DB": "\xDB",
|
|
|
++ "%dc": "\xDC",
|
|
|
++ "%Dc": "\xDC",
|
|
|
++ "%dC": "\xDC",
|
|
|
++ "%DC": "\xDC",
|
|
|
++ "%dd": "\xDD",
|
|
|
++ "%Dd": "\xDD",
|
|
|
++ "%dD": "\xDD",
|
|
|
++ "%DD": "\xDD",
|
|
|
++ "%de": "\xDE",
|
|
|
++ "%De": "\xDE",
|
|
|
++ "%dE": "\xDE",
|
|
|
++ "%DE": "\xDE",
|
|
|
++ "%df": "\xDF",
|
|
|
++ "%Df": "\xDF",
|
|
|
++ "%dF": "\xDF",
|
|
|
++ "%DF": "\xDF",
|
|
|
++ "%e0": "\xE0",
|
|
|
++ "%E0": "\xE0",
|
|
|
++ "%e1": "\xE1",
|
|
|
++ "%E1": "\xE1",
|
|
|
++ "%e2": "\xE2",
|
|
|
++ "%E2": "\xE2",
|
|
|
++ "%e3": "\xE3",
|
|
|
++ "%E3": "\xE3",
|
|
|
++ "%e4": "\xE4",
|
|
|
++ "%E4": "\xE4",
|
|
|
++ "%e5": "\xE5",
|
|
|
++ "%E5": "\xE5",
|
|
|
++ "%e6": "\xE6",
|
|
|
++ "%E6": "\xE6",
|
|
|
++ "%e7": "\xE7",
|
|
|
++ "%E7": "\xE7",
|
|
|
++ "%e8": "\xE8",
|
|
|
++ "%E8": "\xE8",
|
|
|
++ "%e9": "\xE9",
|
|
|
++ "%E9": "\xE9",
|
|
|
++ "%ea": "\xEA",
|
|
|
++ "%Ea": "\xEA",
|
|
|
++ "%eA": "\xEA",
|
|
|
++ "%EA": "\xEA",
|
|
|
++ "%eb": "\xEB",
|
|
|
++ "%Eb": "\xEB",
|
|
|
++ "%eB": "\xEB",
|
|
|
++ "%EB": "\xEB",
|
|
|
++ "%ec": "\xEC",
|
|
|
++ "%Ec": "\xEC",
|
|
|
++ "%eC": "\xEC",
|
|
|
++ "%EC": "\xEC",
|
|
|
++ "%ed": "\xED",
|
|
|
++ "%Ed": "\xED",
|
|
|
++ "%eD": "\xED",
|
|
|
++ "%ED": "\xED",
|
|
|
++ "%ee": "\xEE",
|
|
|
++ "%Ee": "\xEE",
|
|
|
++ "%eE": "\xEE",
|
|
|
++ "%EE": "\xEE",
|
|
|
++ "%ef": "\xEF",
|
|
|
++ "%Ef": "\xEF",
|
|
|
++ "%eF": "\xEF",
|
|
|
++ "%EF": "\xEF",
|
|
|
++ "%f0": "\xF0",
|
|
|
++ "%F0": "\xF0",
|
|
|
++ "%f1": "\xF1",
|
|
|
++ "%F1": "\xF1",
|
|
|
++ "%f2": "\xF2",
|
|
|
++ "%F2": "\xF2",
|
|
|
++ "%f3": "\xF3",
|
|
|
++ "%F3": "\xF3",
|
|
|
++ "%f4": "\xF4",
|
|
|
++ "%F4": "\xF4",
|
|
|
++ "%f5": "\xF5",
|
|
|
++ "%F5": "\xF5",
|
|
|
++ "%f6": "\xF6",
|
|
|
++ "%F6": "\xF6",
|
|
|
++ "%f7": "\xF7",
|
|
|
++ "%F7": "\xF7",
|
|
|
++ "%f8": "\xF8",
|
|
|
++ "%F8": "\xF8",
|
|
|
++ "%f9": "\xF9",
|
|
|
++ "%F9": "\xF9",
|
|
|
++ "%fa": "\xFA",
|
|
|
++ "%Fa": "\xFA",
|
|
|
++ "%fA": "\xFA",
|
|
|
++ "%FA": "\xFA",
|
|
|
++ "%fb": "\xFB",
|
|
|
++ "%Fb": "\xFB",
|
|
|
++ "%fB": "\xFB",
|
|
|
++ "%FB": "\xFB",
|
|
|
++ "%fc": "\xFC",
|
|
|
++ "%Fc": "\xFC",
|
|
|
++ "%fC": "\xFC",
|
|
|
++ "%FC": "\xFC",
|
|
|
++ "%fd": "\xFD",
|
|
|
++ "%Fd": "\xFD",
|
|
|
++ "%fD": "\xFD",
|
|
|
++ "%FD": "\xFD",
|
|
|
++ "%fe": "\xFE",
|
|
|
++ "%Fe": "\xFE",
|
|
|
++ "%fE": "\xFE",
|
|
|
++ "%FE": "\xFE",
|
|
|
++ "%ff": "\xFF",
|
|
|
++ "%Ff": "\xFF",
|
|
|
++ "%fF": "\xFF",
|
|
|
++ "%FF": "\xFF"
|
|
|
++ };
|
|
|
++ function encodedReplacer(match) {
|
|
|
++ return EncodedLookup[match];
|
|
|
++ }
|
|
|
++ __name(encodedReplacer, "encodedReplacer");
|
|
|
++ var STATE_KEY = 0;
|
|
|
++ var STATE_VALUE = 1;
|
|
|
++ var STATE_CHARSET = 2;
|
|
|
++ var STATE_LANG = 3;
|
|
|
+ function parseParams(str) {
|
|
|
+ const res = [];
|
|
|
+- let state = "key";
|
|
|
++ let state = STATE_KEY;
|
|
|
+ let charset = "";
|
|
|
+ let inquote = false;
|
|
|
+ let escaping = false;
|
|
|
+ let p = 0;
|
|
|
+ let tmp = "";
|
|
|
+- for (var i = 0, len = str.length; i < len; ++i) {
|
|
|
++ const len = str.length;
|
|
|
++ for (var i = 0; i < len; ++i) {
|
|
|
+ const char = str[i];
|
|
|
+ if (char === "\\" && inquote) {
|
|
|
+ if (escaping) {
|
|
|
+@@ -2708,7 +3430,7 @@ var require_parseParams = __commonJS({
|
|
|
+ if (!escaping) {
|
|
|
+ if (inquote) {
|
|
|
+ inquote = false;
|
|
|
+- state = "key";
|
|
|
++ state = STATE_KEY;
|
|
|
+ } else {
|
|
|
+ inquote = true;
|
|
|
+ }
|
|
|
+@@ -2721,26 +3443,22 @@ var require_parseParams = __commonJS({
|
|
|
+ tmp += "\\";
|
|
|
+ }
|
|
|
+ escaping = false;
|
|
|
+- if ((state === "charset" || state === "lang") && char === "'") {
|
|
|
+- if (state === "charset") {
|
|
|
+- state = "lang";
|
|
|
++ if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
|
|
|
++ if (state === STATE_CHARSET) {
|
|
|
++ state = STATE_LANG;
|
|
|
+ charset = tmp.substring(1);
|
|
|
+ } else {
|
|
|
+- state = "value";
|
|
|
++ state = STATE_VALUE;
|
|
|
+ }
|
|
|
+ tmp = "";
|
|
|
+ continue;
|
|
|
+- } else if (state === "key" && (char === "*" || char === "=") && res.length) {
|
|
|
+- if (char === "*") {
|
|
|
+- state = "charset";
|
|
|
+- } else {
|
|
|
+- state = "value";
|
|
|
+- }
|
|
|
++ } else if (state === STATE_KEY && (char === "*" || char === "=") && res.length) {
|
|
|
++ state = char === "*" ? STATE_CHARSET : STATE_VALUE;
|
|
|
+ res[p] = [tmp, void 0];
|
|
|
+ tmp = "";
|
|
|
+ continue;
|
|
|
+ } else if (!inquote && char === ";") {
|
|
|
+- state = "key";
|
|
|
++ state = STATE_KEY;
|
|
|
+ if (charset) {
|
|
|
+ if (tmp.length) {
|
|
|
+ tmp = decodeText(
|
|
|
+@@ -2785,6 +3503,7 @@ var require_parseParams = __commonJS({
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
++ __name(parseParams, "parseParams");
|
|
|
+ module2.exports = parseParams;
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -2793,7 +3512,7 @@ var require_parseParams = __commonJS({
|
|
|
+ var require_basename = __commonJS({
|
|
|
+ "node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) {
|
|
|
+ "use strict";
|
|
|
+- module2.exports = function basename(path) {
|
|
|
++ module2.exports = /* @__PURE__ */ __name(function basename(path) {
|
|
|
+ if (typeof path !== "string") {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+@@ -2806,7 +3525,7 @@ var require_basename = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return path === ".." || path === "." ? "" : path;
|
|
|
+- };
|
|
|
++ }, "basename");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+@@ -2850,6 +3569,7 @@ var require_multipart = __commonJS({
|
|
|
+ self.end();
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(checkFinished, "checkFinished");
|
|
|
+ if (typeof boundary !== "string") {
|
|
|
+ throw new Error("Multipart: Boundary not found");
|
|
|
+ }
|
|
|
+@@ -2879,14 +3599,14 @@ var require_multipart = __commonJS({
|
|
|
+ highWaterMark: cfg.highWaterMark
|
|
|
+ };
|
|
|
+ this.parser = new Dicer(parserCfg);
|
|
|
+- this.parser.on("drain", function() {
|
|
|
++ this.parser.on("drain", function () {
|
|
|
+ self._needDrain = false;
|
|
|
+ if (self._cb && !self._pause) {
|
|
|
+ const cb = self._cb;
|
|
|
+ self._cb = void 0;
|
|
|
+ cb();
|
|
|
+ }
|
|
|
+- }).on("part", function onPart(part) {
|
|
|
++ }).on("part", /* @__PURE__ */ __name(function onPart(part) {
|
|
|
+ if (++self._nparts > partsLimit) {
|
|
|
+ self.parser.removeListener("part", onPart);
|
|
|
+ self.parser.on("part", skipPart);
|
|
|
+@@ -2899,7 +3619,7 @@ var require_multipart = __commonJS({
|
|
|
+ field.emit("end");
|
|
|
+ field.removeAllListeners("end");
|
|
|
+ }
|
|
|
+- part.on("header", function(header) {
|
|
|
++ part.on("header", function (header) {
|
|
|
+ let contype;
|
|
|
+ let fieldname;
|
|
|
+ let parsed;
|
|
|
+@@ -2965,7 +3685,7 @@ var require_multipart = __commonJS({
|
|
|
+ ++nends;
|
|
|
+ const file = new FileStream(fileOpts);
|
|
|
+ curFile = file;
|
|
|
+- file.on("end", function() {
|
|
|
++ file.on("end", function () {
|
|
|
+ --nends;
|
|
|
+ self._pause = false;
|
|
|
+ checkFinished();
|
|
|
+@@ -2975,7 +3695,7 @@ var require_multipart = __commonJS({
|
|
|
+ cb();
|
|
|
+ }
|
|
|
+ });
|
|
|
+- file._read = function(n) {
|
|
|
++ file._read = function (n) {
|
|
|
+ if (!self._pause) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+@@ -2987,7 +3707,7 @@ var require_multipart = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ boy.emit("file", fieldname, file, filename, encoding, contype);
|
|
|
+- onData = function(data) {
|
|
|
++ onData = /* @__PURE__ */ __name(function (data) {
|
|
|
+ if ((nsize += data.length) > fileSizeLimit) {
|
|
|
+ const extralen = fileSizeLimit - nsize + data.length;
|
|
|
+ if (extralen > 0) {
|
|
|
+@@ -3002,11 +3722,11 @@ var require_multipart = __commonJS({
|
|
|
+ self._pause = true;
|
|
|
+ }
|
|
|
+ file.bytesRead = nsize;
|
|
|
+- };
|
|
|
+- onEnd = function() {
|
|
|
++ }, "onData");
|
|
|
++ onEnd = /* @__PURE__ */ __name(function () {
|
|
|
+ curFile = void 0;
|
|
|
+ file.push(null);
|
|
|
+- };
|
|
|
++ }, "onEnd");
|
|
|
+ } else {
|
|
|
+ if (nfields === fieldsLimit) {
|
|
|
+ if (!boy.hitFieldsLimit) {
|
|
|
+@@ -3020,7 +3740,7 @@ var require_multipart = __commonJS({
|
|
|
+ let buffer = "";
|
|
|
+ let truncated = false;
|
|
|
+ curField = part;
|
|
|
+- onData = function(data) {
|
|
|
++ onData = /* @__PURE__ */ __name(function (data) {
|
|
|
+ if ((nsize += data.length) > fieldSizeLimit) {
|
|
|
+ const extralen = fieldSizeLimit - (nsize - data.length);
|
|
|
+ buffer += data.toString("binary", 0, extralen);
|
|
|
+@@ -3029,8 +3749,8 @@ var require_multipart = __commonJS({
|
|
|
+ } else {
|
|
|
+ buffer += data.toString("binary");
|
|
|
+ }
|
|
|
+- };
|
|
|
+- onEnd = function() {
|
|
|
++ }, "onData");
|
|
|
++ onEnd = /* @__PURE__ */ __name(function () {
|
|
|
+ curField = void 0;
|
|
|
+ if (buffer.length) {
|
|
|
+ buffer = decodeText(buffer, "binary", charset);
|
|
|
+@@ -3038,24 +3758,25 @@ var require_multipart = __commonJS({
|
|
|
+ boy.emit("field", fieldname, buffer, false, truncated, encoding, contype);
|
|
|
+ --nends;
|
|
|
+ checkFinished();
|
|
|
+- };
|
|
|
++ }, "onEnd");
|
|
|
+ }
|
|
|
+ part._readableState.sync = false;
|
|
|
+ part.on("data", onData);
|
|
|
+ part.on("end", onEnd);
|
|
|
+- }).on("error", function(err) {
|
|
|
++ }).on("error", function (err) {
|
|
|
+ if (curFile) {
|
|
|
+ curFile.emit("error", err);
|
|
|
+ }
|
|
|
+ });
|
|
|
+- }).on("error", function(err) {
|
|
|
++ }, "onPart")).on("error", function (err) {
|
|
|
+ boy.emit("error", err);
|
|
|
+- }).on("finish", function() {
|
|
|
++ }).on("finish", function () {
|
|
|
+ finished = true;
|
|
|
+ checkFinished();
|
|
|
+ });
|
|
|
+ }
|
|
|
+- Multipart.prototype.write = function(chunk, cb) {
|
|
|
++ __name(Multipart, "Multipart");
|
|
|
++ Multipart.prototype.write = function (chunk, cb) {
|
|
|
+ const r = this.parser.write(chunk);
|
|
|
+ if (r && !this._pause) {
|
|
|
+ cb();
|
|
|
+@@ -3064,12 +3785,12 @@ var require_multipart = __commonJS({
|
|
|
+ this._cb = cb;
|
|
|
+ }
|
|
|
+ };
|
|
|
+- Multipart.prototype.end = function() {
|
|
|
++ Multipart.prototype.end = function () {
|
|
|
+ const self = this;
|
|
|
+ if (self.parser.writable) {
|
|
|
+ self.parser.end();
|
|
|
+ } else if (!self._boy._done) {
|
|
|
+- process.nextTick(function() {
|
|
|
++ process.nextTick(function () {
|
|
|
+ self._boy._done = true;
|
|
|
+ self._boy.emit("finish");
|
|
|
+ });
|
|
|
+@@ -3078,13 +3799,15 @@ var require_multipart = __commonJS({
|
|
|
+ function skipPart(part) {
|
|
|
+ part.resume();
|
|
|
+ }
|
|
|
++ __name(skipPart, "skipPart");
|
|
|
+ function FileStream(opts) {
|
|
|
+ Readable.call(this, opts);
|
|
|
+ this.bytesRead = 0;
|
|
|
+ this.truncated = false;
|
|
|
+ }
|
|
|
++ __name(FileStream, "FileStream");
|
|
|
+ inherits(FileStream, Readable);
|
|
|
+- FileStream.prototype._read = function(n) {
|
|
|
++ FileStream.prototype._read = function (n) {
|
|
|
+ };
|
|
|
+ module2.exports = Multipart;
|
|
|
+ }
|
|
|
+@@ -3228,7 +3951,8 @@ var require_Decoder = __commonJS({
|
|
|
+ function Decoder() {
|
|
|
+ this.buffer = void 0;
|
|
|
+ }
|
|
|
+- Decoder.prototype.write = function(str) {
|
|
|
++ __name(Decoder, "Decoder");
|
|
|
++ Decoder.prototype.write = function (str) {
|
|
|
+ str = str.replace(RE_PLUS, " ");
|
|
|
+ let res = "";
|
|
|
+ let i = 0;
|
|
|
+@@ -3262,7 +3986,7 @@ var require_Decoder = __commonJS({
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ };
|
|
|
+- Decoder.prototype.reset = function() {
|
|
|
++ Decoder.prototype.reset = function () {
|
|
|
+ this.buffer = void 0;
|
|
|
+ };
|
|
|
+ module2.exports = Decoder;
|
|
|
+@@ -3308,7 +4032,8 @@ var require_urlencoded = __commonJS({
|
|
|
+ this._valTrunc = false;
|
|
|
+ this._hitLimit = false;
|
|
|
+ }
|
|
|
+- UrlEncoded.prototype.write = function(data, cb) {
|
|
|
++ __name(UrlEncoded, "UrlEncoded");
|
|
|
++ UrlEncoded.prototype.write = function (data, cb) {
|
|
|
+ if (this._fields === this.fieldsLimit) {
|
|
|
+ if (!this.boy.hitFieldsLimit) {
|
|
|
+ this.boy.hitFieldsLimit = true;
|
|
|
+@@ -3456,7 +4181,7 @@ var require_urlencoded = __commonJS({
|
|
|
+ }
|
|
|
+ cb();
|
|
|
+ };
|
|
|
+- UrlEncoded.prototype.end = function() {
|
|
|
++ UrlEncoded.prototype.end = function () {
|
|
|
+ if (this.boy._done) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+@@ -3520,8 +4245,9 @@ var require_main = __commonJS({
|
|
|
+ this._parser = this.getParserByHeaders(headers);
|
|
|
+ this._finished = false;
|
|
|
+ }
|
|
|
++ __name(Busboy, "Busboy");
|
|
|
+ inherits(Busboy, WritableStream);
|
|
|
+- Busboy.prototype.emit = function(ev) {
|
|
|
++ Busboy.prototype.emit = function (ev) {
|
|
|
+ if (ev === "finish") {
|
|
|
+ if (!this._done) {
|
|
|
+ this._parser?.end();
|
|
|
+@@ -3533,7 +4259,7 @@ var require_main = __commonJS({
|
|
|
+ }
|
|
|
+ WritableStream.prototype.emit.apply(this, arguments);
|
|
|
+ };
|
|
|
+- Busboy.prototype.getParserByHeaders = function(headers) {
|
|
|
++ Busboy.prototype.getParserByHeaders = function (headers) {
|
|
|
+ const parsed = parseParams(headers["content-type"]);
|
|
|
+ const cfg = {
|
|
|
+ defCharset: this.opts.defCharset,
|
|
|
+@@ -3553,7 +4279,7 @@ var require_main = __commonJS({
|
|
|
+ }
|
|
|
+ throw new Error("Unsupported Content-Type.");
|
|
|
+ };
|
|
|
+- Busboy.prototype._write = function(chunk, encoding, cb) {
|
|
|
++ Busboy.prototype._write = function (chunk, encoding, cb) {
|
|
|
+ this._parser.write(chunk, cb);
|
|
|
+ };
|
|
|
+ module2.exports = Busboy;
|
|
|
+@@ -3610,6 +4336,7 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return { mimeType: mimeTypeRecord, body };
|
|
|
+ }
|
|
|
++ __name(dataURLProcessor, "dataURLProcessor");
|
|
|
+ function URLSerializer(url, excludeFragment = false) {
|
|
|
+ const href = url.href;
|
|
|
+ if (!excludeFragment) {
|
|
|
+@@ -3621,6 +4348,7 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return href.slice(0, hash);
|
|
|
+ }
|
|
|
++ __name(URLSerializer, "URLSerializer");
|
|
|
+ function collectASequenceOfCodePoints(condition, input, position) {
|
|
|
+ let result = "";
|
|
|
+ while (position.position < input.length && condition(input[position.position])) {
|
|
|
+@@ -3629,6 +4357,7 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
++ __name(collectASequenceOfCodePoints, "collectASequenceOfCodePoints");
|
|
|
+ function collectASequenceOfCodePointsFast(char, input, position) {
|
|
|
+ const idx = input.indexOf(char, position.position);
|
|
|
+ const start = position.position;
|
|
|
+@@ -3639,10 +4368,12 @@ var require_dataURL = __commonJS({
|
|
|
+ position.position = idx;
|
|
|
+ return input.slice(start, position.position);
|
|
|
+ }
|
|
|
++ __name(collectASequenceOfCodePointsFast, "collectASequenceOfCodePointsFast");
|
|
|
+ function stringPercentDecode(input) {
|
|
|
+ const bytes = encoder.encode(input);
|
|
|
+ return percentDecode(bytes);
|
|
|
+ }
|
|
|
++ __name(stringPercentDecode, "stringPercentDecode");
|
|
|
+ function percentDecode(input) {
|
|
|
+ const output = [];
|
|
|
+ for (let i = 0; i < input.length; i++) {
|
|
|
+@@ -3660,6 +4391,7 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return Uint8Array.from(output);
|
|
|
+ }
|
|
|
++ __name(percentDecode, "percentDecode");
|
|
|
+ function parseMIMEType(input) {
|
|
|
+ input = removeHTTPWhitespace(input, true, true);
|
|
|
+ const position = { position: 0 };
|
|
|
+@@ -3742,6 +4474,7 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return mimeType;
|
|
|
+ }
|
|
|
++ __name(parseMIMEType, "parseMIMEType");
|
|
|
+ function forgivingBase64(data) {
|
|
|
+ data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, "");
|
|
|
+ if (data.length % 4 === 0) {
|
|
|
+@@ -3760,6 +4493,7 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return bytes;
|
|
|
+ }
|
|
|
++ __name(forgivingBase64, "forgivingBase64");
|
|
|
+ function collectAnHTTPQuotedString(input, position, extractValue) {
|
|
|
+ const positionStart = position.position;
|
|
|
+ let value = "";
|
|
|
+@@ -3793,6 +4527,7 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return input.slice(positionStart, position.position);
|
|
|
+ }
|
|
|
++ __name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
|
|
|
+ function serializeAMimeType(mimeType) {
|
|
|
+ assert(mimeType !== "failure");
|
|
|
+ const { parameters, essence } = mimeType;
|
|
|
+@@ -3810,9 +4545,11 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return serialization;
|
|
|
+ }
|
|
|
++ __name(serializeAMimeType, "serializeAMimeType");
|
|
|
+ function isHTTPWhiteSpace(char) {
|
|
|
+ return char === "\r" || char === "\n" || char === " " || char === " ";
|
|
|
+ }
|
|
|
++ __name(isHTTPWhiteSpace, "isHTTPWhiteSpace");
|
|
|
+ function removeHTTPWhitespace(str, leading = true, trailing = true) {
|
|
|
+ let lead = 0;
|
|
|
+ let trail = str.length - 1;
|
|
|
+@@ -3826,9 +4563,11 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return str.slice(lead, trail + 1);
|
|
|
+ }
|
|
|
++ __name(removeHTTPWhitespace, "removeHTTPWhitespace");
|
|
|
+ function isASCIIWhitespace(char) {
|
|
|
+ return char === "\r" || char === "\n" || char === " " || char === "\f" || char === " ";
|
|
|
+ }
|
|
|
++ __name(isASCIIWhitespace, "isASCIIWhitespace");
|
|
|
+ function removeASCIIWhitespace(str, leading = true, trailing = true) {
|
|
|
+ let lead = 0;
|
|
|
+ let trail = str.length - 1;
|
|
|
+@@ -3842,6 +4581,7 @@ var require_dataURL = __commonJS({
|
|
|
+ }
|
|
|
+ return str.slice(lead, trail + 1);
|
|
|
+ }
|
|
|
++ __name(removeASCIIWhitespace, "removeASCIIWhitespace");
|
|
|
+ module2.exports = {
|
|
|
+ dataURLProcessor,
|
|
|
+ URLSerializer,
|
|
|
+@@ -3867,6 +4607,9 @@ var require_file = __commonJS({
|
|
|
+ var { parseMIMEType, serializeAMimeType } = require_dataURL();
|
|
|
+ var { kEnumerableProperty } = require_util();
|
|
|
+ var File = class _File extends Blob2 {
|
|
|
++ static {
|
|
|
++ __name(this, "File");
|
|
|
++ }
|
|
|
+ constructor(fileBits, fileName, options = {}) {
|
|
|
+ webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" });
|
|
|
+ fileBits = webidl.converters["sequence<BlobPart>"](fileBits);
|
|
|
+@@ -3907,6 +4650,9 @@ var require_file = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var FileLike = class _FileLike {
|
|
|
++ static {
|
|
|
++ __name(this, "FileLike");
|
|
|
++ }
|
|
|
+ constructor(blobLike, fileName, options = {}) {
|
|
|
+ const n = fileName;
|
|
|
+ const t = options.type;
|
|
|
+@@ -3963,7 +4709,7 @@ var require_file = __commonJS({
|
|
|
+ lastModified: kEnumerableProperty
|
|
|
+ });
|
|
|
+ webidl.converters.Blob = webidl.interfaceConverter(Blob2);
|
|
|
+- webidl.converters.BlobPart = function(V, opts) {
|
|
|
++ webidl.converters.BlobPart = function (V, opts) {
|
|
|
+ if (webidl.util.Type(V) === "Object") {
|
|
|
+ if (isBlobLike(V)) {
|
|
|
+ return webidl.converters.Blob(V, { strict: false });
|
|
|
+@@ -4026,6 +4772,7 @@ var require_file = __commonJS({
|
|
|
+ }
|
|
|
+ return bytes;
|
|
|
+ }
|
|
|
++ __name(processBlobParts, "processBlobParts");
|
|
|
+ function convertLineEndingsNative(s) {
|
|
|
+ let nativeLineEnding = "\n";
|
|
|
+ if (process.platform === "win32") {
|
|
|
+@@ -4033,9 +4780,11 @@ var require_file = __commonJS({
|
|
|
+ }
|
|
|
+ return s.replace(/\r?\n/g, nativeLineEnding);
|
|
|
+ }
|
|
|
++ __name(convertLineEndingsNative, "convertLineEndingsNative");
|
|
|
+ function isFileLike(object) {
|
|
|
+ return NativeFile && object instanceof NativeFile || object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File";
|
|
|
+ }
|
|
|
++ __name(isFileLike, "isFileLike");
|
|
|
+ module2.exports = { File, FileLike, isFileLike };
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -4051,6 +4800,9 @@ var require_formdata = __commonJS({
|
|
|
+ var { Blob: Blob2, File: NativeFile } = require("buffer");
|
|
|
+ var File = NativeFile ?? UndiciFile;
|
|
|
+ var FormData = class _FormData {
|
|
|
++ static {
|
|
|
++ __name(this, "FormData");
|
|
|
++ }
|
|
|
+ constructor(form) {
|
|
|
+ if (form !== void 0) {
|
|
|
+ throw webidl.errors.conversionFailed({
|
|
|
+@@ -4192,6 +4944,7 @@ var require_formdata = __commonJS({
|
|
|
+ }
|
|
|
+ return { name, value };
|
|
|
+ }
|
|
|
++ __name(makeEntry, "makeEntry");
|
|
|
+ module2.exports = { FormData };
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -4264,8 +5017,8 @@ var require_body = __commonJS({
|
|
|
+ const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`;
|
|
|
+ const prefix = `--${boundary}\r
|
|
|
+ Content-Disposition: form-data`;
|
|
|
+- const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
|
|
|
+- const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n");
|
|
|
++ const escape = /* @__PURE__ */ __name((str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "escape");
|
|
|
++ const normalizeLinefeeds = /* @__PURE__ */ __name((value) => value.replace(/\r?\n|\r/g, "\r\n"), "normalizeLinefeeds");
|
|
|
+ const enc = new TextEncoder();
|
|
|
+ const blobParts = [];
|
|
|
+ const rn = new Uint8Array([13, 10]);
|
|
|
+@@ -4299,7 +5052,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ length = null;
|
|
|
+ }
|
|
|
+ source = object;
|
|
|
+- action = async function* () {
|
|
|
++ action = /* @__PURE__ */ __name(async function* () {
|
|
|
+ for (const part of blobParts) {
|
|
|
+ if (part.stream) {
|
|
|
+ yield* part.stream();
|
|
|
+@@ -4307,7 +5060,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ yield part;
|
|
|
+ }
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "action");
|
|
|
+ type = "multipart/form-data; boundary=" + boundary;
|
|
|
+ } else if (isBlobLike(object)) {
|
|
|
+ source = object;
|
|
|
+@@ -4357,6 +5110,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ const body = { stream, source, length };
|
|
|
+ return [body, type];
|
|
|
+ }
|
|
|
++ __name(extractBody, "extractBody");
|
|
|
+ function safelyExtractBody(object, keepalive = false) {
|
|
|
+ if (!ReadableStream) {
|
|
|
+ ReadableStream = require("stream/web").ReadableStream;
|
|
|
+@@ -4367,6 +5121,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ }
|
|
|
+ return extractBody(object, keepalive);
|
|
|
+ }
|
|
|
++ __name(safelyExtractBody, "safelyExtractBody");
|
|
|
+ function cloneBody(body) {
|
|
|
+ const [out1, out2] = body.stream.tee();
|
|
|
+ const out2Clone = structuredClone(out2, { transfer: [out2] });
|
|
|
+@@ -4378,6 +5133,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ source: body.source
|
|
|
+ };
|
|
|
+ }
|
|
|
++ __name(cloneBody, "cloneBody");
|
|
|
+ async function* consumeBody(body) {
|
|
|
+ if (body) {
|
|
|
+ if (isUint8Array(body)) {
|
|
|
+@@ -4395,11 +5151,13 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(consumeBody, "consumeBody");
|
|
|
+ function throwIfAborted(state) {
|
|
|
+ if (state.aborted) {
|
|
|
+ throw new DOMException("The operation was aborted.", "AbortError");
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(throwIfAborted, "throwIfAborted");
|
|
|
+ function bodyMixinMethods(instance) {
|
|
|
+ const methods = {
|
|
|
+ blob() {
|
|
|
+@@ -4435,9 +5193,10 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ const responseFormData = new FormData();
|
|
|
+ let busboy;
|
|
|
+ try {
|
|
|
+- busboy = new Busboy({
|
|
|
++ busboy = Busboy({
|
|
|
+ headers,
|
|
|
+- preservePath: true
|
|
|
++ preservePath: true,
|
|
|
++ defParamCharset: "utf8"
|
|
|
+ });
|
|
|
+ } catch (err) {
|
|
|
+ throw new DOMException(`${err}`, "AbortError");
|
|
|
+@@ -4445,7 +5204,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ busboy.on("field", (name, value) => {
|
|
|
+ responseFormData.append(name, value);
|
|
|
+ });
|
|
|
+- busboy.on("file", (name, value, filename, encoding, mimeType) => {
|
|
|
++ busboy.on("file", (name, value, info) => {
|
|
|
++ const { filename, encoding, mimeType } = info;
|
|
|
+ const chunks = [];
|
|
|
+ if (encoding === "base64" || encoding.toLowerCase() === "base64") {
|
|
|
+ let base64chunk = "";
|
|
|
+@@ -4511,9 +5271,11 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ };
|
|
|
+ return methods;
|
|
|
+ }
|
|
|
++ __name(bodyMixinMethods, "bodyMixinMethods");
|
|
|
+ function mixinBody(prototype) {
|
|
|
+ Object.assign(prototype.prototype, bodyMixinMethods(prototype));
|
|
|
+ }
|
|
|
++ __name(mixinBody, "mixinBody");
|
|
|
+ async function specConsumeBody(object, convertBytesToJSValue, instance) {
|
|
|
+ webidl.brandCheck(object, instance);
|
|
|
+ throwIfAborted(object[kState]);
|
|
|
+@@ -4521,14 +5283,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ throw new TypeError("Body is unusable");
|
|
|
+ }
|
|
|
+ const promise = createDeferredPromise();
|
|
|
+- const errorSteps = (error) => promise.reject(error);
|
|
|
+- const successSteps = (data) => {
|
|
|
++ const errorSteps = /* @__PURE__ */ __name((error) => promise.reject(error), "errorSteps");
|
|
|
++ const successSteps = /* @__PURE__ */ __name((data) => {
|
|
|
+ try {
|
|
|
+ promise.resolve(convertBytesToJSValue(data));
|
|
|
+ } catch (e) {
|
|
|
+ errorSteps(e);
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "successSteps");
|
|
|
+ if (object[kState].body == null) {
|
|
|
+ successSteps(new Uint8Array());
|
|
|
+ return promise.promise;
|
|
|
+@@ -4536,9 +5298,11 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ await fullyReadBody(object[kState].body, successSteps, errorSteps);
|
|
|
+ return promise.promise;
|
|
|
+ }
|
|
|
++ __name(specConsumeBody, "specConsumeBody");
|
|
|
+ function bodyUnusable(body) {
|
|
|
+ return body != null && (body.stream.locked || util.isDisturbed(body.stream));
|
|
|
+ }
|
|
|
++ __name(bodyUnusable, "bodyUnusable");
|
|
|
+ function utf8DecodeBytes(buffer) {
|
|
|
+ if (buffer.length === 0) {
|
|
|
+ return "";
|
|
|
+@@ -4549,9 +5313,11 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ const output = new TextDecoder().decode(buffer);
|
|
|
+ return output;
|
|
|
+ }
|
|
|
++ __name(utf8DecodeBytes, "utf8DecodeBytes");
|
|
|
+ function parseJSONFromBytes(bytes) {
|
|
|
+ return JSON.parse(utf8DecodeBytes(bytes));
|
|
|
+ }
|
|
|
++ __name(parseJSONFromBytes, "parseJSONFromBytes");
|
|
|
+ function bodyMimeType(object) {
|
|
|
+ const { headersList } = object[kState];
|
|
|
+ const contentType = headersList.get("content-type");
|
|
|
+@@ -4560,6 +5326,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
+ }
|
|
|
+ return parseMIMEType(contentType);
|
|
|
+ }
|
|
|
++ __name(bodyMimeType, "bodyMimeType");
|
|
|
+ module2.exports = {
|
|
|
+ extractBody,
|
|
|
+ safelyExtractBody,
|
|
|
+@@ -4601,6 +5368,9 @@ var require_response = __commonJS({
|
|
|
+ var { types } = require("util");
|
|
|
+ var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream;
|
|
|
+ var Response = class _Response {
|
|
|
++ static {
|
|
|
++ __name(this, "Response");
|
|
|
++ }
|
|
|
+ // Creates network error Response.
|
|
|
+ static error() {
|
|
|
+ const relevantRealm = { settingsObject: {} };
|
|
|
+@@ -4777,6 +5547,7 @@ var require_response = __commonJS({
|
|
|
+ }
|
|
|
+ return newResponse;
|
|
|
+ }
|
|
|
++ __name(cloneResponse, "cloneResponse");
|
|
|
+ function makeResponse(init) {
|
|
|
+ return {
|
|
|
+ aborted: false,
|
|
|
+@@ -4793,6 +5564,7 @@ var require_response = __commonJS({
|
|
|
+ urlList: init.urlList ? [...init.urlList] : []
|
|
|
+ };
|
|
|
+ }
|
|
|
++ __name(makeResponse, "makeResponse");
|
|
|
+ function makeNetworkError(reason) {
|
|
|
+ const isError = isErrorLike(reason);
|
|
|
+ return makeResponse({
|
|
|
+@@ -4802,6 +5574,7 @@ var require_response = __commonJS({
|
|
|
+ aborted: reason && reason.name === "AbortError"
|
|
|
+ });
|
|
|
+ }
|
|
|
++ __name(makeNetworkError, "makeNetworkError");
|
|
|
+ function makeFilteredResponse(response, state) {
|
|
|
+ state = {
|
|
|
+ internalResponse: response,
|
|
|
+@@ -4818,6 +5591,7 @@ var require_response = __commonJS({
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
++ __name(makeFilteredResponse, "makeFilteredResponse");
|
|
|
+ function filterResponse(response, type) {
|
|
|
+ if (type === "basic") {
|
|
|
+ return makeFilteredResponse(response, {
|
|
|
+@@ -4849,10 +5623,12 @@ var require_response = __commonJS({
|
|
|
+ assert(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(filterResponse, "filterResponse");
|
|
|
+ function makeAppropriateNetworkError(fetchParams, err = null) {
|
|
|
+ assert(isCancelled(fetchParams));
|
|
|
+ return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err }));
|
|
|
+ }
|
|
|
++ __name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
|
|
|
+ function initializeResponse(response, init, body) {
|
|
|
+ if (init.status !== null && (init.status < 200 || init.status > 599)) {
|
|
|
+ throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');
|
|
|
+@@ -4884,6 +5660,7 @@ var require_response = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(initializeResponse, "initializeResponse");
|
|
|
+ webidl.converters.ReadableStream = webidl.interfaceConverter(
|
|
|
+ ReadableStream
|
|
|
+ );
|
|
|
+@@ -4893,7 +5670,7 @@ var require_response = __commonJS({
|
|
|
+ webidl.converters.URLSearchParams = webidl.interfaceConverter(
|
|
|
+ URLSearchParams
|
|
|
+ );
|
|
|
+- webidl.converters.XMLHttpRequestBodyInit = function(V) {
|
|
|
++ webidl.converters.XMLHttpRequestBodyInit = function (V) {
|
|
|
+ if (typeof V === "string") {
|
|
|
+ return webidl.converters.USVString(V);
|
|
|
+ }
|
|
|
+@@ -4911,7 +5688,7 @@ var require_response = __commonJS({
|
|
|
+ }
|
|
|
+ return webidl.converters.DOMString(V);
|
|
|
+ };
|
|
|
+- webidl.converters.BodyInit = function(V) {
|
|
|
++ webidl.converters.BodyInit = function (V) {
|
|
|
+ if (V instanceof ReadableStream) {
|
|
|
+ return webidl.converters.ReadableStream(V);
|
|
|
+ }
|
|
|
+@@ -4953,6 +5730,9 @@ var require_dispatcher_weakref = __commonJS({
|
|
|
+ "use strict";
|
|
|
+ var { kConnected, kSize } = require_symbols();
|
|
|
+ var CompatWeakRef = class {
|
|
|
++ static {
|
|
|
++ __name(this, "CompatWeakRef");
|
|
|
++ }
|
|
|
+ constructor(value) {
|
|
|
+ this.value = value;
|
|
|
+ }
|
|
|
+@@ -4961,6 +5741,9 @@ var require_dispatcher_weakref = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var CompatFinalizer = class {
|
|
|
++ static {
|
|
|
++ __name(this, "CompatFinalizer");
|
|
|
++ }
|
|
|
+ constructor(finalizer) {
|
|
|
+ this.finalizer = finalizer;
|
|
|
+ }
|
|
|
+@@ -4974,13 +5757,7 @@ var require_dispatcher_weakref = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+- module2.exports = function() {
|
|
|
+- if (process.env.NODE_V8_COVERAGE) {
|
|
|
+- return {
|
|
|
+- WeakRef: CompatWeakRef,
|
|
|
+- FinalizationRegistry: CompatFinalizer
|
|
|
+- };
|
|
|
+- }
|
|
|
++ module2.exports = function () {
|
|
|
+ return {
|
|
|
+ WeakRef: global.WeakRef || CompatWeakRef,
|
|
|
+ FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
|
|
|
+@@ -5028,6 +5805,9 @@ var require_request = __commonJS({
|
|
|
+ signal.removeEventListener("abort", abort);
|
|
|
+ });
|
|
|
+ var Request = class _Request {
|
|
|
++ static {
|
|
|
++ __name(this, "Request");
|
|
|
++ }
|
|
|
+ // https://fetch.spec.whatwg.org/#dom-request
|
|
|
+ constructor(input, init = {}) {
|
|
|
+ if (input === kInit) {
|
|
|
+@@ -5219,12 +5999,12 @@ var require_request = __commonJS({
|
|
|
+ } else {
|
|
|
+ this[kAbortController] = ac;
|
|
|
+ const acRef = new WeakRef(ac);
|
|
|
+- const abort = function() {
|
|
|
++ const abort = /* @__PURE__ */ __name(function () {
|
|
|
+ const ac2 = acRef.deref();
|
|
|
+ if (ac2 !== void 0) {
|
|
|
+ ac2.abort(this.reason);
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "abort");
|
|
|
+ try {
|
|
|
+ if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) {
|
|
|
+ setMaxListeners(100, signal);
|
|
|
+@@ -5500,6 +6280,7 @@ var require_request = __commonJS({
|
|
|
+ request.url = request.urlList[0];
|
|
|
+ return request;
|
|
|
+ }
|
|
|
++ __name(makeRequest, "makeRequest");
|
|
|
+ function cloneRequest(request) {
|
|
|
+ const newRequest = makeRequest({ ...request, body: null });
|
|
|
+ if (request.body != null) {
|
|
|
+@@ -5507,6 +6288,7 @@ var require_request = __commonJS({
|
|
|
+ }
|
|
|
+ return newRequest;
|
|
|
+ }
|
|
|
++ __name(cloneRequest, "cloneRequest");
|
|
|
+ Object.defineProperties(Request.prototype, {
|
|
|
+ method: kEnumerableProperty,
|
|
|
+ url: kEnumerableProperty,
|
|
|
+@@ -5536,7 +6318,7 @@ var require_request = __commonJS({
|
|
|
+ webidl.converters.Request = webidl.interfaceConverter(
|
|
|
+ Request
|
|
|
+ );
|
|
|
+- webidl.converters.RequestInfo = function(V) {
|
|
|
++ webidl.converters.RequestInfo = function (V) {
|
|
|
+ if (typeof V === "string") {
|
|
|
+ return webidl.converters.USVString(V);
|
|
|
+ }
|
|
|
+@@ -5634,6 +6416,9 @@ var require_dispatcher = __commonJS({
|
|
|
+ "use strict";
|
|
|
+ var EventEmitter = require("events");
|
|
|
+ var Dispatcher = class extends EventEmitter {
|
|
|
++ static {
|
|
|
++ __name(this, "Dispatcher");
|
|
|
++ }
|
|
|
+ dispatch() {
|
|
|
+ throw new Error("not implemented");
|
|
|
+ }
|
|
|
+@@ -5665,6 +6450,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
+ var kOnClosed = Symbol("onClosed");
|
|
|
+ var kInterceptedDispatch = Symbol("Intercepted Dispatch");
|
|
|
+ var DispatcherBase = class extends Dispatcher {
|
|
|
++ static {
|
|
|
++ __name(this, "DispatcherBase");
|
|
|
++ }
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this[kDestroyed] = false;
|
|
|
+@@ -5717,13 +6505,13 @@ var require_dispatcher_base = __commonJS({
|
|
|
+ }
|
|
|
+ this[kClosed] = true;
|
|
|
+ this[kOnClosed].push(callback);
|
|
|
+- const onClosed = () => {
|
|
|
++ const onClosed = /* @__PURE__ */ __name(() => {
|
|
|
+ const callbacks = this[kOnClosed];
|
|
|
+ this[kOnClosed] = null;
|
|
|
+ for (let i = 0; i < callbacks.length; i++) {
|
|
|
+ callbacks[i](null, null);
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "onClosed");
|
|
|
+ this[kClose]().then(() => this.destroy()).then(() => {
|
|
|
+ queueMicrotask(onClosed);
|
|
|
+ });
|
|
|
+@@ -5760,13 +6548,13 @@ var require_dispatcher_base = __commonJS({
|
|
|
+ this[kDestroyed] = true;
|
|
|
+ this[kOnDestroyed] = this[kOnDestroyed] || [];
|
|
|
+ this[kOnDestroyed].push(callback);
|
|
|
+- const onDestroyed = () => {
|
|
|
++ const onDestroyed = /* @__PURE__ */ __name(() => {
|
|
|
+ const callbacks = this[kOnDestroyed];
|
|
|
+ this[kOnDestroyed] = null;
|
|
|
+ for (let i = 0; i < callbacks.length; i++) {
|
|
|
+ callbacks[i](null, null);
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "onDestroyed");
|
|
|
+ this[kDestroy](err).then(() => {
|
|
|
+ queueMicrotask(onDestroyed);
|
|
|
+ });
|
|
|
+@@ -5818,6 +6606,9 @@ var require_fixed_queue = __commonJS({
|
|
|
+ var kSize = 2048;
|
|
|
+ var kMask = kSize - 1;
|
|
|
+ var FixedCircularBuffer = class {
|
|
|
++ static {
|
|
|
++ __name(this, "FixedCircularBuffer");
|
|
|
++ }
|
|
|
+ constructor() {
|
|
|
+ this.bottom = 0;
|
|
|
+ this.top = 0;
|
|
|
+@@ -5844,6 +6635,9 @@ var require_fixed_queue = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ module2.exports = class FixedQueue {
|
|
|
++ static {
|
|
|
++ __name(this, "FixedQueue");
|
|
|
++ }
|
|
|
+ constructor() {
|
|
|
+ this.head = this.tail = new FixedCircularBuffer();
|
|
|
+ }
|
|
|
+@@ -5874,6 +6668,9 @@ var require_pool_stats = __commonJS({
|
|
|
+ var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols();
|
|
|
+ var kPool = Symbol("pool");
|
|
|
+ var PoolStats = class {
|
|
|
++ static {
|
|
|
++ __name(this, "PoolStats");
|
|
|
++ }
|
|
|
+ constructor(pool) {
|
|
|
+ this[kPool] = pool;
|
|
|
+ }
|
|
|
+@@ -5921,13 +6718,16 @@ var require_pool_base = __commonJS({
|
|
|
+ var kRemoveClient = Symbol("remove client");
|
|
|
+ var kStats = Symbol("stats");
|
|
|
+ var PoolBase = class extends DispatcherBase {
|
|
|
++ static {
|
|
|
++ __name(this, "PoolBase");
|
|
|
++ }
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this[kQueue] = new FixedQueue();
|
|
|
+ this[kClients] = [];
|
|
|
+ this[kQueued] = 0;
|
|
|
+ const pool = this;
|
|
|
+- this[kOnDrain] = function onDrain(origin, targets) {
|
|
|
++ this[kOnDrain] = /* @__PURE__ */ __name(function onDrain(origin, targets) {
|
|
|
+ const queue = pool[kQueue];
|
|
|
+ let needDrain = false;
|
|
|
+ while (!needDrain) {
|
|
|
+@@ -5946,7 +6746,7 @@ var require_pool_base = __commonJS({
|
|
|
+ if (pool[kClosedResolve] && queue.isEmpty()) {
|
|
|
+ Promise.all(pool[kClients].map((c) => c.close())).then(pool[kClosedResolve]);
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "onDrain");
|
|
|
+ this[kOnConnect] = (origin, targets) => {
|
|
|
+ pool.emit("connect", origin, [pool, ...targets]);
|
|
|
+ };
|
|
|
+@@ -6090,6 +6890,7 @@ var require_timers = __commonJS({
|
|
|
+ refreshTimeout();
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(onTimeout, "onTimeout");
|
|
|
+ function refreshTimeout() {
|
|
|
+ if (fastNowTimeout && fastNowTimeout.refresh) {
|
|
|
+ fastNowTimeout.refresh();
|
|
|
+@@ -6101,7 +6902,11 @@ var require_timers = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(refreshTimeout, "refreshTimeout");
|
|
|
+ var Timeout = class {
|
|
|
++ static {
|
|
|
++ __name(this, "Timeout");
|
|
|
++ }
|
|
|
+ constructor(callback, delay, opaque) {
|
|
|
+ this.callback = callback;
|
|
|
+ this.delay = delay;
|
|
|
+@@ -6169,6 +6974,9 @@ var require_request2 = __commonJS({
|
|
|
+ channels.error = { hasSubscribers: false };
|
|
|
+ }
|
|
|
+ var Request = class _Request {
|
|
|
++ static {
|
|
|
++ __name(this, "Request");
|
|
|
++ }
|
|
|
+ constructor(origin, {
|
|
|
+ path,
|
|
|
+ method,
|
|
|
+@@ -6400,6 +7208,7 @@ var require_request2 = __commonJS({
|
|
|
+ return skipAppend ? val : `${key}: ${val}\r
|
|
|
+ `;
|
|
|
+ }
|
|
|
++ __name(processHeaderValue, "processHeaderValue");
|
|
|
+ function processHeader(request, key, val, skipAppend = false) {
|
|
|
+ if (val && (typeof val === "object" && !Array.isArray(val))) {
|
|
|
+ throw new InvalidArgumentError(`invalid ${key} header`);
|
|
|
+@@ -6459,6 +7268,7 @@ var require_request2 = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(processHeader, "processHeader");
|
|
|
+ module2.exports = Request;
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -6473,8 +7283,11 @@ var require_connect = __commonJS({
|
|
|
+ var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
|
|
|
+ var tls;
|
|
|
+ var SessionCache;
|
|
|
+- if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
|
|
|
++ if (global.FinalizationRegistry) {
|
|
|
+ SessionCache = class WeakSessionCache {
|
|
|
++ static {
|
|
|
++ __name(this, "WeakSessionCache");
|
|
|
++ }
|
|
|
+ constructor(maxCachedSessions) {
|
|
|
+ this._maxCachedSessions = maxCachedSessions;
|
|
|
+ this._sessionCache = /* @__PURE__ */ new Map();
|
|
|
+@@ -6502,6 +7315,9 @@ var require_connect = __commonJS({
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ SessionCache = class SimpleSessionCache {
|
|
|
++ static {
|
|
|
++ __name(this, "SimpleSessionCache");
|
|
|
++ }
|
|
|
+ constructor(maxCachedSessions) {
|
|
|
+ this._maxCachedSessions = maxCachedSessions;
|
|
|
+ this._sessionCache = /* @__PURE__ */ new Map();
|
|
|
+@@ -6529,7 +7345,7 @@ var require_connect = __commonJS({
|
|
|
+ const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
|
|
|
+ timeout = timeout == null ? 1e4 : timeout;
|
|
|
+ allowH2 = allowH2 != null ? allowH2 : false;
|
|
|
+- return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
|
|
|
++ return /* @__PURE__ */ __name(function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
|
|
|
+ let socket;
|
|
|
+ if (protocol === "https:") {
|
|
|
+ if (!tls) {
|
|
|
+@@ -6553,7 +7369,7 @@ var require_connect = __commonJS({
|
|
|
+ port: port || 443,
|
|
|
+ host: hostname
|
|
|
+ });
|
|
|
+- socket.on("session", function(session2) {
|
|
|
++ socket.on("session", function (session2) {
|
|
|
+ sessionCache.set(sessionKey, session2);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+@@ -6572,14 +7388,14 @@ var require_connect = __commonJS({
|
|
|
+ socket.setKeepAlive(true, keepAliveInitialDelay);
|
|
|
+ }
|
|
|
+ const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout);
|
|
|
+- socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() {
|
|
|
++ socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function () {
|
|
|
+ cancelTimeout();
|
|
|
+ if (callback) {
|
|
|
+ const cb = callback;
|
|
|
+ callback = null;
|
|
|
+ cb(null, this);
|
|
|
+ }
|
|
|
+- }).on("error", function(err) {
|
|
|
++ }).on("error", function (err) {
|
|
|
+ cancelTimeout();
|
|
|
+ if (callback) {
|
|
|
+ const cb = callback;
|
|
|
+@@ -6588,8 +7404,9 @@ var require_connect = __commonJS({
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return socket;
|
|
|
+- };
|
|
|
++ }, "connect");
|
|
|
+ }
|
|
|
++ __name(buildConnector, "buildConnector");
|
|
|
+ function setupTimeout(onConnectTimeout2, timeout) {
|
|
|
+ if (!timeout) {
|
|
|
+ return () => {
|
|
|
+@@ -6612,9 +7429,11 @@ var require_connect = __commonJS({
|
|
|
+ clearImmediate(s2);
|
|
|
+ };
|
|
|
+ }
|
|
|
++ __name(setupTimeout, "setupTimeout");
|
|
|
+ function onConnectTimeout(socket) {
|
|
|
+ util.destroy(socket, new ConnectTimeoutError());
|
|
|
+ }
|
|
|
++ __name(onConnectTimeout, "onConnectTimeout");
|
|
|
+ module2.exports = buildConnector;
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -6635,6 +7454,7 @@ var require_utils = __commonJS({
|
|
|
+ });
|
|
|
+ return res;
|
|
|
+ }
|
|
|
++ __name(enumToMap, "enumToMap");
|
|
|
+ exports2.enumToMap = enumToMap;
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -6647,7 +7467,7 @@ var require_constants2 = __commonJS({
|
|
|
+ exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0;
|
|
|
+ var utils_1 = require_utils();
|
|
|
+ var ERROR;
|
|
|
+- (function(ERROR2) {
|
|
|
++ (function (ERROR2) {
|
|
|
+ ERROR2[ERROR2["OK"] = 0] = "OK";
|
|
|
+ ERROR2[ERROR2["INTERNAL"] = 1] = "INTERNAL";
|
|
|
+ ERROR2[ERROR2["STRICT"] = 2] = "STRICT";
|
|
|
+@@ -6675,13 +7495,13 @@ var require_constants2 = __commonJS({
|
|
|
+ ERROR2[ERROR2["USER"] = 24] = "USER";
|
|
|
+ })(ERROR = exports2.ERROR || (exports2.ERROR = {}));
|
|
|
+ var TYPE;
|
|
|
+- (function(TYPE2) {
|
|
|
++ (function (TYPE2) {
|
|
|
+ TYPE2[TYPE2["BOTH"] = 0] = "BOTH";
|
|
|
+ TYPE2[TYPE2["REQUEST"] = 1] = "REQUEST";
|
|
|
+ TYPE2[TYPE2["RESPONSE"] = 2] = "RESPONSE";
|
|
|
+ })(TYPE = exports2.TYPE || (exports2.TYPE = {}));
|
|
|
+ var FLAGS;
|
|
|
+- (function(FLAGS2) {
|
|
|
++ (function (FLAGS2) {
|
|
|
+ FLAGS2[FLAGS2["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
|
|
|
+ FLAGS2[FLAGS2["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
|
|
|
+ FLAGS2[FLAGS2["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
|
|
|
+@@ -6693,13 +7513,13 @@ var require_constants2 = __commonJS({
|
|
|
+ FLAGS2[FLAGS2["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
|
|
|
+ })(FLAGS = exports2.FLAGS || (exports2.FLAGS = {}));
|
|
|
+ var LENIENT_FLAGS;
|
|
|
+- (function(LENIENT_FLAGS2) {
|
|
|
++ (function (LENIENT_FLAGS2) {
|
|
|
+ LENIENT_FLAGS2[LENIENT_FLAGS2["HEADERS"] = 1] = "HEADERS";
|
|
|
+ LENIENT_FLAGS2[LENIENT_FLAGS2["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
|
|
|
+ LENIENT_FLAGS2[LENIENT_FLAGS2["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
|
|
|
+ })(LENIENT_FLAGS = exports2.LENIENT_FLAGS || (exports2.LENIENT_FLAGS = {}));
|
|
|
+ var METHODS;
|
|
|
+- (function(METHODS2) {
|
|
|
++ (function (METHODS2) {
|
|
|
+ METHODS2[METHODS2["DELETE"] = 0] = "DELETE";
|
|
|
+ METHODS2[METHODS2["GET"] = 1] = "GET";
|
|
|
+ METHODS2[METHODS2["HEAD"] = 2] = "HEAD";
|
|
|
+@@ -6813,7 +7633,7 @@ var require_constants2 = __commonJS({
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var FINISH;
|
|
|
+- (function(FINISH2) {
|
|
|
++ (function (FINISH2) {
|
|
|
+ FINISH2[FINISH2["SAFE"] = 0] = "SAFE";
|
|
|
+ FINISH2[FINISH2["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
|
|
|
+ FINISH2[FINISH2["UNSAFE"] = 2] = "UNSAFE";
|
|
|
+@@ -6939,7 +7759,7 @@ var require_constants2 = __commonJS({
|
|
|
+ exports2.MAJOR = exports2.NUM_MAP;
|
|
|
+ exports2.MINOR = exports2.MAJOR;
|
|
|
+ var HEADER_STATE;
|
|
|
+- (function(HEADER_STATE2) {
|
|
|
++ (function (HEADER_STATE2) {
|
|
|
+ HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL";
|
|
|
+ HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION";
|
|
|
+ HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
|
|
|
+@@ -6972,6 +7792,9 @@ var require_RedirectHandler = __commonJS({
|
|
|
+ var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
|
|
+ var kBody = Symbol("body");
|
|
|
+ var BodyAsyncIterable = class {
|
|
|
++ static {
|
|
|
++ __name(this, "BodyAsyncIterable");
|
|
|
++ }
|
|
|
+ constructor(body) {
|
|
|
+ this[kBody] = body;
|
|
|
+ this[kBodyUsed] = false;
|
|
|
+@@ -6983,6 +7806,9 @@ var require_RedirectHandler = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var RedirectHandler = class {
|
|
|
++ static {
|
|
|
++ __name(this, "RedirectHandler");
|
|
|
++ }
|
|
|
+ constructor(dispatch, maxRedirections, opts, handler) {
|
|
|
+ if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
|
|
|
+ throw new InvalidArgumentError("maxRedirections must be a positive number");
|
|
|
+@@ -6997,13 +7823,13 @@ var require_RedirectHandler = __commonJS({
|
|
|
+ this.history = [];
|
|
|
+ if (util.isStream(this.opts.body)) {
|
|
|
+ if (util.bodyLength(this.opts.body) === 0) {
|
|
|
+- this.opts.body.on("data", function() {
|
|
|
++ this.opts.body.on("data", function () {
|
|
|
+ assert(false);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (typeof this.opts.body.readableDidRead !== "boolean") {
|
|
|
+ this.opts.body[kBodyUsed] = false;
|
|
|
+- EE.prototype.on.call(this.opts.body, "data", function() {
|
|
|
++ EE.prototype.on.call(this.opts.body, "data", function () {
|
|
|
+ this[kBodyUsed] = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+@@ -7074,9 +7900,11 @@ var require_RedirectHandler = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(parseLocation, "parseLocation");
|
|
|
+ function shouldRemoveHeader(header, removeContent, unknownOrigin) {
|
|
|
+ return header.length === 4 && header.toString().toLowerCase() === "host" || removeContent && header.toString().toLowerCase().indexOf("content-") === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === "authorization" || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === "cookie";
|
|
|
+ }
|
|
|
++ __name(shouldRemoveHeader, "shouldRemoveHeader");
|
|
|
+ function cleanRequestHeaders(headers, removeContent, unknownOrigin) {
|
|
|
+ const ret = [];
|
|
|
+ if (Array.isArray(headers)) {
|
|
|
+@@ -7096,6 +7924,7 @@ var require_RedirectHandler = __commonJS({
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
++ __name(cleanRequestHeaders, "cleanRequestHeaders");
|
|
|
+ module2.exports = RedirectHandler;
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -7107,7 +7936,7 @@ var require_redirectInterceptor = __commonJS({
|
|
|
+ var RedirectHandler = require_RedirectHandler();
|
|
|
+ function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) {
|
|
|
+ return (dispatch) => {
|
|
|
+- return function Intercept(opts, handler) {
|
|
|
++ return /* @__PURE__ */ __name(function Intercept(opts, handler) {
|
|
|
+ const { maxRedirections = defaultMaxRedirections } = opts;
|
|
|
+ if (!maxRedirections) {
|
|
|
+ return dispatch(opts, handler);
|
|
|
+@@ -7115,9 +7944,10 @@ var require_redirectInterceptor = __commonJS({
|
|
|
+ const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler);
|
|
|
+ opts = { ...opts, maxRedirections: 0 };
|
|
|
+ return dispatch(opts, redirectHandler);
|
|
|
+- };
|
|
|
++ }, "Intercept");
|
|
|
+ };
|
|
|
+ }
|
|
|
++ __name(createRedirectInterceptor, "createRedirectInterceptor");
|
|
|
+ module2.exports = createRedirectInterceptor;
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -7249,6 +8079,9 @@ var require_client = __commonJS({
|
|
|
+ channels.connected = { hasSubscribers: false };
|
|
|
+ }
|
|
|
+ var Client = class extends DispatcherBase {
|
|
|
++ static {
|
|
|
++ __name(this, "Client");
|
|
|
++ }
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {string|URL} url
|
|
|
+@@ -7456,13 +8289,13 @@ var require_client = __commonJS({
|
|
|
+ const request = requests[i];
|
|
|
+ errorRequest(this, request, err);
|
|
|
+ }
|
|
|
+- const callback = () => {
|
|
|
++ const callback = /* @__PURE__ */ __name(() => {
|
|
|
+ if (this[kClosedResolve]) {
|
|
|
+ this[kClosedResolve]();
|
|
|
+ this[kClosedResolve] = null;
|
|
|
+ }
|
|
|
+ resolve();
|
|
|
+- };
|
|
|
++ }, "callback");
|
|
|
+ if (this[kHTTP2Session] != null) {
|
|
|
+ util.destroy(this[kHTTP2Session], err);
|
|
|
+ this[kHTTP2Session] = null;
|
|
|
+@@ -7482,6 +8315,7 @@ var require_client = __commonJS({
|
|
|
+ this[kSocket][kError] = err;
|
|
|
+ onError(this[kClient], err);
|
|
|
+ }
|
|
|
++ __name(onHttp2SessionError, "onHttp2SessionError");
|
|
|
+ function onHttp2FrameError(type, code, id) {
|
|
|
+ const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`);
|
|
|
+ if (id === 0) {
|
|
|
+@@ -7489,10 +8323,12 @@ var require_client = __commonJS({
|
|
|
+ onError(this[kClient], err);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(onHttp2FrameError, "onHttp2FrameError");
|
|
|
+ function onHttp2SessionEnd() {
|
|
|
+ util.destroy(this, new SocketError("other side closed"));
|
|
|
+ util.destroy(this[kSocket], new SocketError("other side closed"));
|
|
|
+ }
|
|
|
++ __name(onHttp2SessionEnd, "onHttp2SessionEnd");
|
|
|
+ function onHTTP2GoAway(code) {
|
|
|
+ const client = this[kClient];
|
|
|
+ const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`);
|
|
|
+@@ -7520,6 +8356,7 @@ var require_client = __commonJS({
|
|
|
+ );
|
|
|
+ resume(client);
|
|
|
+ }
|
|
|
++ __name(onHTTP2GoAway, "onHTTP2GoAway");
|
|
|
+ var constants = require_constants2();
|
|
|
+ var createRedirectInterceptor = require_redirectInterceptor();
|
|
|
+ var EMPTY_BUF = Buffer.alloc(0);
|
|
|
+@@ -7573,6 +8410,7 @@ var require_client = __commonJS({
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
++ __name(lazyllhttp, "lazyllhttp");
|
|
|
+ var llhttpInstance = null;
|
|
|
+ var llhttpPromise = lazyllhttp();
|
|
|
+ llhttpPromise.catch();
|
|
|
+@@ -7584,6 +8422,9 @@ var require_client = __commonJS({
|
|
|
+ var TIMEOUT_BODY = 2;
|
|
|
+ var TIMEOUT_IDLE = 3;
|
|
|
+ var Parser = class {
|
|
|
++ static {
|
|
|
++ __name(this, "Parser");
|
|
|
++ }
|
|
|
+ constructor(client, socket, { exports: exports3 }) {
|
|
|
+ assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0);
|
|
|
+ this.llhttp = exports3;
|
|
|
+@@ -7807,7 +8648,7 @@ var require_client = __commonJS({
|
|
|
+ assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS);
|
|
|
+ this.statusCode = statusCode;
|
|
|
+ this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
|
|
|
+- request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive";
|
|
|
++ request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive";
|
|
|
+ if (this.statusCode >= 200) {
|
|
|
+ const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout];
|
|
|
+ this.setTimeout(bodyTimeout, TIMEOUT_BODY);
|
|
|
+@@ -7960,10 +8801,12 @@ var require_client = __commonJS({
|
|
|
+ util.destroy(socket, new InformationalError("socket idle timeout"));
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(onParserTimeout, "onParserTimeout");
|
|
|
+ function onSocketReadable() {
|
|
|
+ const { [kParser]: parser } = this;
|
|
|
+ parser.readMore();
|
|
|
+ }
|
|
|
++ __name(onSocketReadable, "onSocketReadable");
|
|
|
+ function onSocketError(err) {
|
|
|
+ const { [kClient]: client, [kParser]: parser } = this;
|
|
|
+ assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
|
+@@ -7976,6 +8819,7 @@ var require_client = __commonJS({
|
|
|
+ this[kError] = err;
|
|
|
+ onError(this[kClient], err);
|
|
|
+ }
|
|
|
++ __name(onSocketError, "onSocketError");
|
|
|
+ function onError(client, err) {
|
|
|
+ if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
|
|
|
+ assert(client[kPendingIdx] === client[kRunningIdx]);
|
|
|
+@@ -7987,6 +8831,7 @@ var require_client = __commonJS({
|
|
|
+ assert(client[kSize] === 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(onError, "onError");
|
|
|
+ function onSocketEnd() {
|
|
|
+ const { [kParser]: parser, [kClient]: client } = this;
|
|
|
+ if (client[kHTTPConnVersion] !== "h2") {
|
|
|
+@@ -7997,6 +8842,7 @@ var require_client = __commonJS({
|
|
|
+ }
|
|
|
+ util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this)));
|
|
|
+ }
|
|
|
++ __name(onSocketEnd, "onSocketEnd");
|
|
|
+ function onSocketClose() {
|
|
|
+ const { [kClient]: client, [kParser]: parser } = this;
|
|
|
+ if (client[kHTTPConnVersion] === "h1" && parser) {
|
|
|
+@@ -8025,6 +8871,7 @@ var require_client = __commonJS({
|
|
|
+ client.emit("disconnect", client[kUrl], [client], err);
|
|
|
+ resume(client);
|
|
|
+ }
|
|
|
++ __name(onSocketClose, "onSocketClose");
|
|
|
+ async function connect(client) {
|
|
|
+ assert(!client[kConnecting]);
|
|
|
+ assert(!client[kSocket]);
|
|
|
+@@ -8161,10 +9008,12 @@ var require_client = __commonJS({
|
|
|
+ }
|
|
|
+ resume(client);
|
|
|
+ }
|
|
|
++ __name(connect, "connect");
|
|
|
+ function emitDrain(client) {
|
|
|
+ client[kNeedDrain] = 0;
|
|
|
+ client.emit("drain", client[kUrl], [client]);
|
|
|
+ }
|
|
|
++ __name(emitDrain, "emitDrain");
|
|
|
+ function resume(client, sync) {
|
|
|
+ if (client[kResuming] === 2) {
|
|
|
+ return;
|
|
|
+@@ -8178,6 +9027,7 @@ var require_client = __commonJS({
|
|
|
+ client[kRunningIdx] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(resume, "resume");
|
|
|
+ function _resume(client, sync) {
|
|
|
+ while (true) {
|
|
|
+ if (client.destroyed) {
|
|
|
+@@ -8260,12 +9110,12 @@ var require_client = __commonJS({
|
|
|
+ request.body.on(
|
|
|
+ "data",
|
|
|
+ /* istanbul ignore next */
|
|
|
+- function() {
|
|
|
++ function () {
|
|
|
+ assert(false);
|
|
|
+ }
|
|
|
+- ).on("error", function(err) {
|
|
|
++ ).on("error", function (err) {
|
|
|
+ errorRequest(client, request, err);
|
|
|
+- }).on("end", function() {
|
|
|
++ }).on("end", function () {
|
|
|
+ util.destroy(this);
|
|
|
+ });
|
|
|
+ request.body = null;
|
|
|
+@@ -8280,6 +9130,7 @@ var require_client = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(_resume, "_resume");
|
|
|
+ function write(client, request) {
|
|
|
+ if (client[kHTTPConnVersion] === "h2") {
|
|
|
+ writeH2(client, client[kHTTP2Session], request);
|
|
|
+@@ -8396,6 +9247,7 @@ upgrade: ${upgrade}\r
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
++ __name(write, "write");
|
|
|
+ function writeH2(client, session, request) {
|
|
|
+ const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
|
|
|
+ let headers;
|
|
|
+@@ -8498,7 +9350,7 @@ upgrade: ${upgrade}\r
|
|
|
+ if (h2State.openStreams === 0)
|
|
|
+ session.unref();
|
|
|
+ });
|
|
|
+- stream.once("error", function(err) {
|
|
|
++ stream.once("error", function (err) {
|
|
|
+ if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
|
|
|
+ h2State.streams -= 1;
|
|
|
+ util.destroy(stream, err);
|
|
|
+@@ -8574,13 +9426,16 @@ upgrade: ${upgrade}\r
|
|
|
+ assert(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(writeBodyH2, "writeBodyH2");
|
|
|
+ }
|
|
|
++ __name(writeH2, "writeH2");
|
|
|
+ function writeStream({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
|
|
|
+ assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
|
|
|
+ if (client[kHTTPConnVersion] === "h2") {
|
|
|
+- let onPipeData = function(chunk) {
|
|
|
++ let onPipeData = function (chunk) {
|
|
|
+ request.onBodySent(chunk);
|
|
|
+ };
|
|
|
++ __name(onPipeData, "onPipeData");
|
|
|
+ const pipe = pipeline(
|
|
|
+ body,
|
|
|
+ h2stream,
|
|
|
+@@ -8602,7 +9457,7 @@ upgrade: ${upgrade}\r
|
|
|
+ }
|
|
|
+ let finished = false;
|
|
|
+ const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header });
|
|
|
+- const onData = function(chunk) {
|
|
|
++ const onData = /* @__PURE__ */ __name(function (chunk) {
|
|
|
+ if (finished) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+@@ -8613,19 +9468,19 @@ upgrade: ${upgrade}\r
|
|
|
+ } catch (err) {
|
|
|
+ util.destroy(this, err);
|
|
|
+ }
|
|
|
+- };
|
|
|
+- const onDrain = function() {
|
|
|
++ }, "onData");
|
|
|
++ const onDrain = /* @__PURE__ */ __name(function () {
|
|
|
+ if (finished) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (body.resume) {
|
|
|
+ body.resume();
|
|
|
+ }
|
|
|
+- };
|
|
|
+- const onAbort = function() {
|
|
|
++ }, "onDrain");
|
|
|
++ const onAbort = /* @__PURE__ */ __name(function () {
|
|
|
+ onFinished(new RequestAbortedError());
|
|
|
+- };
|
|
|
+- const onFinished = function(err) {
|
|
|
++ }, "onAbort");
|
|
|
++ const onFinished = /* @__PURE__ */ __name(function (err) {
|
|
|
+ if (finished) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+@@ -8646,13 +9501,14 @@ upgrade: ${upgrade}\r
|
|
|
+ } else {
|
|
|
+ util.destroy(body);
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "onFinished");
|
|
|
+ body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort);
|
|
|
+ if (body.resume) {
|
|
|
+ body.resume();
|
|
|
+ }
|
|
|
+ socket.on("drain", onDrain).on("error", onFinished);
|
|
|
+ }
|
|
|
++ __name(writeStream, "writeStream");
|
|
|
+ async function writeBlob({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
|
|
|
+ assert(contentLength === body.size, "blob body must have content length");
|
|
|
+ const isH2 = client[kHTTPConnVersion] === "h2";
|
|
|
+@@ -8683,6 +9539,7 @@ upgrade: ${upgrade}\r
|
|
|
+ util.destroy(isH2 ? h2stream : socket, err);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(writeBlob, "writeBlob");
|
|
|
+ async function writeIterable({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
|
|
|
+ assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
|
|
|
+ let callback = null;
|
|
|
+@@ -8693,14 +9550,15 @@ upgrade: ${upgrade}\r
|
|
|
+ cb();
|
|
|
+ }
|
|
|
+ }
|
|
|
+- const waitForDrain = () => new Promise((resolve, reject) => {
|
|
|
++ __name(onDrain, "onDrain");
|
|
|
++ const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve, reject) => {
|
|
|
+ assert(callback === null);
|
|
|
+ if (socket[kError]) {
|
|
|
+ reject(socket[kError]);
|
|
|
+ } else {
|
|
|
+ callback = resolve;
|
|
|
+ }
|
|
|
+- });
|
|
|
++ }), "waitForDrain");
|
|
|
+ if (client[kHTTPConnVersion] === "h2") {
|
|
|
+ h2stream.on("close", onDrain).on("drain", onDrain);
|
|
|
+ try {
|
|
|
+@@ -8741,7 +9599,11 @@ upgrade: ${upgrade}\r
|
|
|
+ socket.off("close", onDrain).off("drain", onDrain);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(writeIterable, "writeIterable");
|
|
|
+ var AsyncWriter = class {
|
|
|
++ static {
|
|
|
++ __name(this, "AsyncWriter");
|
|
|
++ }
|
|
|
+ constructor({ socket, request, contentLength, client, expectsPayload, header }) {
|
|
|
+ this.socket = socket;
|
|
|
+ this.request = request;
|
|
|
+@@ -8855,6 +9717,7 @@ ${len.toString(16)}\r
|
|
|
+ client.emit("error", err2);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(errorRequest, "errorRequest");
|
|
|
+ module2.exports = Client;
|
|
|
+ }
|
|
|
+ });
|
|
|
+@@ -8883,7 +9746,11 @@ var require_pool = __commonJS({
|
|
|
+ function defaultFactory(origin, opts) {
|
|
|
+ return new Client(origin, opts);
|
|
|
+ }
|
|
|
++ __name(defaultFactory, "defaultFactory");
|
|
|
+ var Pool = class extends PoolBase {
|
|
|
++ static {
|
|
|
++ __name(this, "Pool");
|
|
|
++ }
|
|
|
+ constructor(origin, {
|
|
|
+ connections,
|
|
|
+ factory = defaultFactory,
|
|
|
+@@ -8964,7 +9831,11 @@ var require_agent = __commonJS({
|
|
|
+ function defaultFactory(origin, opts) {
|
|
|
+ return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts);
|
|
|
+ }
|
|
|
++ __name(defaultFactory, "defaultFactory");
|
|
|
+ var Agent = class extends DispatcherBase {
|
|
|
++ static {
|
|
|
++ __name(this, "Agent");
|
|
|
++ }
|
|
|
+ constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
|
|
|
+ super();
|
|
|
+ if (typeof factory !== "function") {
|
|
|
+@@ -9080,9 +9951,11 @@ var require_global2 = __commonJS({
|
|
|
+ configurable: false
|
|
|
+ });
|
|
|
+ }
|
|
|
++ __name(setGlobalDispatcher, "setGlobalDispatcher");
|
|
|
+ function getGlobalDispatcher() {
|
|
|
+ return globalThis[globalDispatcher];
|
|
|
+ }
|
|
|
++ __name(getGlobalDispatcher, "getGlobalDispatcher");
|
|
|
+ module2.exports = {
|
|
|
+ setGlobalDispatcher,
|
|
|
+ getGlobalDispatcher
|
|
|
+@@ -9157,6 +10030,9 @@ var require_fetch = __commonJS({
|
|
|
+ var resolveObjectURL;
|
|
|
+ var ReadableStream = globalThis.ReadableStream;
|
|
|
+ var Fetch = class extends EE {
|
|
|
++ static {
|
|
|
++ __name(this, "Fetch");
|
|
|
++ }
|
|
|
+ constructor(dispatcher) {
|
|
|
+ super();
|
|
|
+ this.dispatcher = dispatcher;
|
|
|
+@@ -9219,8 +10095,8 @@ var require_fetch = __commonJS({
|
|
|
+ abortFetch(p, request, responseObject, requestObject.signal.reason);
|
|
|
+ }
|
|
|
+ );
|
|
|
+- const handleFetchDone = (response) => finalizeAndReportTiming(response, "fetch");
|
|
|
+- const processResponse = (response) => {
|
|
|
++ const handleFetchDone = /* @__PURE__ */ __name((response) => finalizeAndReportTiming(response, "fetch"), "handleFetchDone");
|
|
|
++ const processResponse = /* @__PURE__ */ __name((response) => {
|
|
|
+ if (locallyAborted) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+@@ -9241,7 +10117,7 @@ var require_fetch = __commonJS({
|
|
|
+ responseObject[kHeaders][kGuard] = "immutable";
|
|
|
+ responseObject[kHeaders][kRealm] = relevantRealm;
|
|
|
+ p.resolve(responseObject);
|
|
|
+- };
|
|
|
++ }, "processResponse");
|
|
|
+ controller = fetching({
|
|
|
+ request,
|
|
|
+ processResponseEndOfBody: handleFetchDone,
|
|
|
+@@ -9251,6 +10127,7 @@ var require_fetch = __commonJS({
|
|
|
+ });
|
|
|
+ return p.promise;
|
|
|
+ }
|
|
|
++ __name(fetch2, "fetch");
|
|
|
+ function finalizeAndReportTiming(response, initiatorType = "other") {
|
|
|
+ if (response.type === "error" && response.aborted) {
|
|
|
+ return;
|
|
|
+@@ -9283,11 +10160,13 @@ var require_fetch = __commonJS({
|
|
|
+ cacheState
|
|
|
+ );
|
|
|
+ }
|
|
|
++ __name(finalizeAndReportTiming, "finalizeAndReportTiming");
|
|
|
+ function markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState) {
|
|
|
+ if (nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 2) {
|
|
|
+ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(markResourceTiming, "markResourceTiming");
|
|
|
+ function abortFetch(p, request, responseObject, error) {
|
|
|
+ if (!error) {
|
|
|
+ error = new DOMException("The operation was aborted.", "AbortError");
|
|
|
+@@ -9314,6 +10193,7 @@ var require_fetch = __commonJS({
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(abortFetch, "abortFetch");
|
|
|
+ function fetching({
|
|
|
+ request,
|
|
|
+ processRequestBodyChunkLength,
|
|
|
+@@ -9379,6 +10259,7 @@ var require_fetch = __commonJS({
|
|
|
+ });
|
|
|
+ return fetchParams.controller;
|
|
|
+ }
|
|
|
++ __name(fetching, "fetching");
|
|
|
+ async function mainFetch(fetchParams, recursive = false) {
|
|
|
+ const request = fetchParams.request;
|
|
|
+ let response = null;
|
|
|
+@@ -9458,24 +10339,25 @@ var require_fetch = __commonJS({
|
|
|
+ fetchParams.controller.dump = true;
|
|
|
+ }
|
|
|
+ if (request.integrity) {
|
|
|
+- const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason));
|
|
|
++ const processBodyError = /* @__PURE__ */ __name((reason) => fetchFinale(fetchParams, makeNetworkError(reason)), "processBodyError");
|
|
|
+ if (request.responseTainting === "opaque" || response.body == null) {
|
|
|
+ processBodyError(response.error);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+- const processBody = (bytes) => {
|
|
|
++ const processBody = /* @__PURE__ */ __name((bytes) => {
|
|
|
+ if (!bytesMatch(bytes, request.integrity)) {
|
|
|
+ processBodyError("integrity mismatch");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ response.body = safelyExtractBody(bytes)[0];
|
|
|
+ fetchFinale(fetchParams, response);
|
|
|
+- };
|
|
|
++ }, "processBody");
|
|
|
+ await fullyReadBody(response.body, processBody, processBodyError);
|
|
|
+ } else {
|
|
|
+ fetchFinale(fetchParams, response);
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(mainFetch, "mainFetch");
|
|
|
+ async function schemeFetch(fetchParams) {
|
|
|
+ if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
|
|
|
+ return makeAppropriateNetworkError(fetchParams);
|
|
|
+@@ -9539,12 +10421,14 @@ var require_fetch = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(schemeFetch, "schemeFetch");
|
|
|
+ function finalizeResponse(fetchParams, response) {
|
|
|
+ fetchParams.request.done = true;
|
|
|
+ if (fetchParams.processResponseDone != null) {
|
|
|
+ queueMicrotask(() => fetchParams.processResponseDone(response));
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(finalizeResponse, "finalizeResponse");
|
|
|
+ async function fetchFinale(fetchParams, response) {
|
|
|
+ if (response.type === "error") {
|
|
|
+ response.urlList = [fetchParams.request.urlList[0]];
|
|
|
+@@ -9552,21 +10436,21 @@ var require_fetch = __commonJS({
|
|
|
+ startTime: fetchParams.timingInfo.startTime
|
|
|
+ });
|
|
|
+ }
|
|
|
+- const processResponseEndOfBody = () => {
|
|
|
++ const processResponseEndOfBody = /* @__PURE__ */ __name(() => {
|
|
|
+ fetchParams.request.done = true;
|
|
|
+ if (fetchParams.processResponseEndOfBody != null) {
|
|
|
+ queueMicrotask(() => fetchParams.processResponseEndOfBody(response));
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "processResponseEndOfBody");
|
|
|
+ if (fetchParams.processResponse != null) {
|
|
|
+ queueMicrotask(() => fetchParams.processResponse(response));
|
|
|
+ }
|
|
|
+ if (response.body == null) {
|
|
|
+ processResponseEndOfBody();
|
|
|
+ } else {
|
|
|
+- const identityTransformAlgorithm = (chunk, controller) => {
|
|
|
++ const identityTransformAlgorithm = /* @__PURE__ */ __name((chunk, controller) => {
|
|
|
+ controller.enqueue(chunk);
|
|
|
+- };
|
|
|
++ }, "identityTransformAlgorithm");
|
|
|
+ const transformStream = new TransformStream({
|
|
|
+ start() {
|
|
|
+ },
|
|
|
+@@ -9584,8 +10468,8 @@ var require_fetch = __commonJS({
|
|
|
+ response.body = { stream: response.body.stream.pipeThrough(transformStream) };
|
|
|
+ }
|
|
|
+ if (fetchParams.processResponseConsumeBody != null) {
|
|
|
+- const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes);
|
|
|
+- const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure);
|
|
|
++ const processBody = /* @__PURE__ */ __name((nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes), "processBody");
|
|
|
++ const processBodyError = /* @__PURE__ */ __name((failure) => fetchParams.processResponseConsumeBody(response, failure), "processBodyError");
|
|
|
+ if (response.body == null) {
|
|
|
+ queueMicrotask(() => processBody(null));
|
|
|
+ } else {
|
|
|
+@@ -9593,6 +10477,7 @@ var require_fetch = __commonJS({
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(fetchFinale, "fetchFinale");
|
|
|
+ async function httpFetch(fetchParams) {
|
|
|
+ const request = fetchParams.request;
|
|
|
+ let response = null;
|
|
|
+@@ -9637,6 +10522,7 @@ var require_fetch = __commonJS({
|
|
|
+ response.timingInfo = timingInfo;
|
|
|
+ return response;
|
|
|
+ }
|
|
|
++ __name(httpFetch, "httpFetch");
|
|
|
+ async function httpRedirectFetch(fetchParams, response) {
|
|
|
+ const request = fetchParams.request;
|
|
|
+ const actualResponse = response.internalResponse ? response.internalResponse : response;
|
|
|
+@@ -9695,6 +10581,7 @@ var require_fetch = __commonJS({
|
|
|
+ setRequestReferrerPolicyOnRedirect(request, actualResponse);
|
|
|
+ return mainFetch(fetchParams, true);
|
|
|
+ }
|
|
|
++ __name(httpRedirectFetch, "httpRedirectFetch");
|
|
|
+ async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) {
|
|
|
+ const request = fetchParams.request;
|
|
|
+ let httpFetchParams = null;
|
|
|
+@@ -9815,6 +10702,7 @@ var require_fetch = __commonJS({
|
|
|
+ }
|
|
|
+ return response;
|
|
|
+ }
|
|
|
++ __name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
|
|
|
+ async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
|
|
|
+ assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
|
|
|
+ fetchParams.controller.connection = {
|
|
|
+@@ -9842,22 +10730,22 @@ var require_fetch = __commonJS({
|
|
|
+ if (request.body == null && fetchParams.processRequestEndOfBody) {
|
|
|
+ queueMicrotask(() => fetchParams.processRequestEndOfBody());
|
|
|
+ } else if (request.body != null) {
|
|
|
+- const processBodyChunk = async function* (bytes) {
|
|
|
++ const processBodyChunk = /* @__PURE__ */ __name(async function* (bytes) {
|
|
|
+ if (isCancelled(fetchParams)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ yield bytes;
|
|
|
+ fetchParams.processRequestBodyChunkLength?.(bytes.byteLength);
|
|
|
+- };
|
|
|
+- const processEndOfBody = () => {
|
|
|
++ }, "processBodyChunk");
|
|
|
++ const processEndOfBody = /* @__PURE__ */ __name(() => {
|
|
|
+ if (isCancelled(fetchParams)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (fetchParams.processRequestEndOfBody) {
|
|
|
+ fetchParams.processRequestEndOfBody();
|
|
|
+ }
|
|
|
+- };
|
|
|
+- const processBodyError = (e) => {
|
|
|
++ }, "processEndOfBody");
|
|
|
++ const processBodyError = /* @__PURE__ */ __name((e) => {
|
|
|
+ if (isCancelled(fetchParams)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+@@ -9866,7 +10754,7 @@ var require_fetch = __commonJS({
|
|
|
+ } else {
|
|
|
+ fetchParams.controller.terminate(e);
|
|
|
+ }
|
|
|
+- };
|
|
|
++ }, "processBodyError");
|
|
|
+ requestBody = async function* () {
|
|
|
+ try {
|
|
|
+ for await (const bytes of request.body.stream) {
|
|
|
+@@ -9894,12 +10782,12 @@ var require_fetch = __commonJS({
|
|
|
+ }
|
|
|
+ return makeNetworkError(err);
|
|
|
+ }
|
|
|
+- const pullAlgorithm = () => {
|
|
|
++ const pullAlgorithm = /* @__PURE__ */ __name(() => {
|
|
|
+ fetchParams.controller.resume();
|
|
|
+- };
|
|
|
+- const cancelAlgorithm = (reason) => {
|
|
|
++ }, "pullAlgorithm");
|
|
|
++ const cancelAlgorithm = /* @__PURE__ */ __name((reason) => {
|
|
|
+ fetchParams.controller.abort(reason);
|
|
|
+- };
|
|
|
++ }, "cancelAlgorithm");
|
|
|
+ if (!ReadableStream) {
|
|
|
+ ReadableStream = require("stream/web").ReadableStream;
|
|
|
+ }
|
|
|
+@@ -9979,6 +10867,7 @@ var require_fetch = __commonJS({
|
|
|
+ }
|
|
|
+ fetchParams.controller.connection.destroy();
|
|
|
+ }
|
|
|
++ __name(onAborted, "onAborted");
|
|
|
+ return response;
|
|
|
+ async function dispatch({ body }) {
|
|
|
+ const url = requestCurrentURL(request);
|
|
|
+@@ -10113,7 +11002,9 @@ var require_fetch = __commonJS({
|
|
|
+ }
|
|
|
+ ));
|
|
|
+ }
|
|
|
++ __name(dispatch, "dispatch");
|
|
|
+ }
|
|
|
++ __name(httpNetworkFetch, "httpNetworkFetch");
|
|
|
+ module2.exports = {
|
|
|
+ fetch: fetch2,
|
|
|
+ Fetch,
|
|
|
+@@ -10192,6 +11083,9 @@ var require_events = __commonJS({
|
|
|
+ var { kEnumerableProperty } = require_util();
|
|
|
+ var { MessagePort } = require("worker_threads");
|
|
|
+ var MessageEvent = class _MessageEvent extends Event {
|
|
|
++ static {
|
|
|
++ __name(this, "MessageEvent");
|
|
|
++ }
|
|
|
+ #eventInit;
|
|
|
+ constructor(type, eventInitDict = {}) {
|
|
|
+ webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent constructor" });
|
|
|
+@@ -10238,6 +11132,9 @@ var require_events = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var CloseEvent = class _CloseEvent extends Event {
|
|
|
++ static {
|
|
|
++ __name(this, "CloseEvent");
|
|
|
++ }
|
|
|
+ #eventInit;
|
|
|
+ constructor(type, eventInitDict = {}) {
|
|
|
+ webidl.argumentLengthCheck(arguments, 1, { header: "CloseEvent constructor" });
|
|
|
+@@ -10260,6 +11157,9 @@ var require_events = __commonJS({
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var ErrorEvent = class _ErrorEvent extends Event {
|
|
|
++ static {
|
|
|
++ __name(this, "ErrorEvent");
|
|
|
++ }
|
|
|
+ #eventInit;
|
|
|
+ constructor(type, eventInitDict) {
|
|
|
+ webidl.argumentLengthCheck(arguments, 1, { header: "ErrorEvent constructor" });
|
|
|
+@@ -10437,16 +11337,20 @@ var require_util3 = __commonJS({
|
|
|
+ function isEstablished(ws) {
|
|
|
+ return ws[kReadyState] === states.OPEN;
|
|
|
+ }
|
|
|
++ __name(isEstablished, "isEstablished");
|
|
|
+ function isClosing(ws) {
|
|
|
+ return ws[kReadyState] === states.CLOSING;
|
|
|
+ }
|
|
|
++ __name(isClosing, "isClosing");
|
|
|
+ function isClosed(ws) {
|
|
|
+ return ws[kReadyState] === states.CLOSED;
|
|
|
+ }
|
|
|
++ __name(isClosed, "isClosed");
|
|
|
+ function fireEvent(e, target, eventConstructor = Event, eventInitDict) {
|
|
|
+ const event = new eventConstructor(e, eventInitDict);
|
|
|
+ target.dispatchEvent(event);
|
|
|
+ }
|
|
|
++ __name(fireEvent, "fireEvent");
|
|
|
+ function websocketMessageReceived(ws, type, data) {
|
|
|
+ if (ws[kReadyState] !== states.OPEN) {
|
|
|
+ return;
|
|
|
+@@ -10471,6 +11375,7 @@ var require_util3 = __commonJS({
|
|
|
+ data: dataForEvent
|
|
|
+ });
|
|
|
+ }
|
|
|
++ __name(websocketMessageReceived, "websocketMessageReceived");
|
|
|
+ function isValidSubprotocol(protocol) {
|
|
|
+ if (protocol.length === 0) {
|
|
|
+ return false;
|
|
|
+@@ -10478,20 +11383,22 @@ var require_util3 = __commonJS({
|
|
|
+ for (const char of protocol) {
|
|
|
+ const code = char.charCodeAt(0);
|
|
|
+ if (code < 33 || code > 126 || char === "(" || char === ")" || char === "<" || char === ">" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\" || char === '"' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}" || code === 32 || // SP
|
|
|
+- code === 9) {
|
|
|
++ code === 9) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
++ __name(isValidSubprotocol, "isValidSubprotocol");
|
|
|
+ function isValidStatusCode(code) {
|
|
|
+ if (code >= 1e3 && code < 1015) {
|
|
|
+ return code !== 1004 && // reserved
|
|
|
+- code !== 1005 && // "MUST NOT be set as a status code"
|
|
|
+- code !== 1006;
|
|
|
++ code !== 1005 && // "MUST NOT be set as a status code"
|
|
|
++ code !== 1006;
|
|
|
+ }
|
|
|
+ return code >= 3e3 && code <= 4999;
|
|
|
+ }
|
|
|
++ __name(isValidStatusCode, "isValidStatusCode");
|
|
|
+ function failWebsocketConnection(ws, reason) {
|
|
|
+ const { [kController]: controller, [kResponse]: response } = ws;
|
|
|
+ controller.abort();
|
|
|
+@@ -10504,6 +11411,7 @@ var require_util3 = __commonJS({
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(failWebsocketConnection, "failWebsocketConnection");
|
|
|
+ module2.exports = {
|
|
|
+ isEstablished,
|
|
|
+ isClosing,
|
|
|
+@@ -10620,11 +11528,13 @@ var require_connection = __commonJS({
|
|
|
+ });
|
|
|
+ return controller;
|
|
|
+ }
|
|
|
++ __name(establishWebSocketConnection, "establishWebSocketConnection");
|
|
|
+ function onSocketData(chunk) {
|
|
|
+ if (!this.ws[kByteParser].write(chunk)) {
|
|
|
+ this.pause();
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(onSocketData, "onSocketData");
|
|
|
+ function onSocketClose() {
|
|
|
+ const { ws } = this;
|
|
|
+ const wasClean = ws[kSentClose] && ws[kReceivedClose];
|
|
|
+@@ -10651,6 +11561,7 @@ var require_connection = __commonJS({
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
++ __name(onSocketClose, "onSocketClose");
|
|
|
+ function onSocketError(error) {
|
|
|
+ const { ws } = this;
|
|
|
+ ws[kReadyState] = states.CLOSING;
|
|
|
+@@ -10659,6 +11570,7 @@ var require_connection = __commonJS({
|
|
|
+ }
|
|
|
+ this.destroy();
|
|
|
+ }
|
|
|
++ __name(onSocketError, "onSocketError");
|
|
|
+ module2.exports = {
|
|
|
+ establishWebSocketConnection
|
|
|
+ };
|
|
|
+@@ -10676,6 +11588,9 @@ var require_frame = __commonJS({
|
|
|
+ } catch {
|
|
|
+ }
|
|
|
+ var WebsocketFrameSend = class {
|
|
|
++ static {
|
|
|
++ __name(this, "WebsocketFrameSend");
|
|
|
++ }
|
|
|
+ /**
|
|
|
+ * @param {Buffer|undefined} data
|
|
|
+ */
|
|
|
+@@ -10736,6 +11651,9 @@ var require_receiver = __commonJS({
|
|
|
+ channels.ping = diagnosticsChannel.channel("undici:websocket:ping");
|
|
|
+ channels.pong = diagnosticsChannel.channel("undici:websocket:pong");
|
|
|
+ var ByteParser = class extends Writable {
|
|
|
++ static {
|
|
|
++ __name(this, "ByteParser");
|
|
|
++ }
|
|
|
+ #buffers = [];
|
|
|
+ #byteOffset = 0;
|
|
|
+ #state = parserStates.INFO;
|
|
|
+@@ -10985,6 +11903,9 @@ var require_websocket = __commonJS({
|
|
|
+ var { types } = require("util");
|
|
|
+ var experimentalWarned = false;
|
|
|
+ var WebSocket = class _WebSocket extends EventTarget {
|
|
|
++ static {
|
|
|
++ __name(this, "WebSocket");
|
|
|
++ }
|
|
|
+ #events = {
|
|
|
+ open: null,
|
|
|
+ error: null,
|
|
|
+@@ -11260,9 +12181,9 @@ var require_websocket = __commonJS({
|
|
|
+ #onConnectionEstablished(response) {
|
|
|
+ this[kResponse] = response;
|
|
|
+ const parser = new ByteParser(this);
|
|
|
+- parser.on("drain", function onParserDrain() {
|
|
|
++ parser.on("drain", /* @__PURE__ */ __name(function onParserDrain() {
|
|
|
+ this.ws[kResponse].socket.resume();
|
|
|
+- });
|
|
|
++ }, "onParserDrain"));
|
|
|
+ response.socket.ws = this;
|
|
|
+ this[kByteParser] = parser;
|
|
|
+ this[kReadyState] = states.OPEN;
|
|
|
+@@ -11314,7 +12235,7 @@ var require_websocket = __commonJS({
|
|
|
+ webidl.converters["sequence<DOMString>"] = webidl.sequenceConverter(
|
|
|
+ webidl.converters.DOMString
|
|
|
+ );
|
|
|
+- webidl.converters["DOMString or sequence<DOMString>"] = function(V) {
|
|
|
++ webidl.converters["DOMString or sequence<DOMString>"] = function (V) {
|
|
|
+ if (webidl.util.Type(V) === "Object" && Symbol.iterator in V) {
|
|
|
+ return webidl.converters["sequence<DOMString>"](V);
|
|
|
+ }
|
|
|
+@@ -11340,13 +12261,13 @@ var require_websocket = __commonJS({
|
|
|
+ converter: webidl.nullableConverter(webidl.converters.HeadersInit)
|
|
|
+ }
|
|
|
+ ]);
|
|
|
+- webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"] = function(V) {
|
|
|
++ webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"] = function (V) {
|
|
|
+ if (webidl.util.Type(V) === "Object" && !(Symbol.iterator in V)) {
|
|
|
+ return webidl.converters.WebSocketInit(V);
|
|
|
+ }
|
|
|
+ return { protocols: webidl.converters["DOMString or sequence<DOMString>"](V) };
|
|
|
+ };
|
|
|
+- webidl.converters.WebSocketSendData = function(V) {
|
|
|
++ webidl.converters.WebSocketSendData = function (V) {
|
|
|
+ if (webidl.util.Type(V) === "Object") {
|
|
|
+ if (isBlobLike(V)) {
|
|
|
+ return webidl.converters.Blob(V, { strict: false });
|
|
|
+@@ -11365,24 +12286,18 @@ var require_websocket = __commonJS({
|
|
|
+
|
|
|
+ // index-fetch.js
|
|
|
+ var fetchImpl = require_fetch().fetch;
|
|
|
+-module.exports.fetch = async function fetch(resource, init = void 0) {
|
|
|
++module.exports.fetch = /* @__PURE__ */ __name(async function fetch(resource, init = void 0) {
|
|
|
+ try {
|
|
|
+ return await fetchImpl(resource, init);
|
|
|
+ } catch (err) {
|
|
|
+ Error.captureStackTrace(err, this);
|
|
|
+ throw err;
|
|
|
+ }
|
|
|
+-};
|
|
|
++}, "fetch");
|
|
|
+ module.exports.FormData = require_formdata().FormData;
|
|
|
+ module.exports.Headers = require_headers().Headers;
|
|
|
+ module.exports.Response = require_response().Response;
|
|
|
+ module.exports.Request = require_request().Request;
|
|
|
+ module.exports.WebSocket = require_websocket().WebSocket;
|
|
|
+-/*! Bundled license information:
|
|
|
+-
|
|
|
+-undici/lib/fetch/body.js:
|
|
|
+- (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
|
+-
|
|
|
+-undici/lib/websocket/frame.js:
|
|
|
+- (*! ws. MIT License. Einar Otto Stangvik <[email protected]> *)
|
|
|
+-*/
|
|
|
++/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
|
++/*! ws. MIT License. Einar Otto Stangvik <[email protected]> */
|