diff --git a/dist/index.js b/dist/index.js index 46b35df..6f1feae 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,10 +1,9 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ +import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; +/******/ var __webpack_modules__ = ({ /***/ 4914: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -107,7 +106,6 @@ function escapeProperty(s) { /***/ 7484: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -458,7 +456,6 @@ exports.platform = __importStar(__nccwpck_require__(8968)); /***/ 4753: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; // For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { @@ -527,7 +524,6 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ 5306: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -611,7 +607,6 @@ exports.OidcClient = OidcClient; /***/ 1976: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -680,7 +675,6 @@ exports.toPlatformPath = toPlatformPath; /***/ 8968: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -781,7 +775,6 @@ exports.getDetails = getDetails; /***/ 1847: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -1071,7 +1064,6 @@ exports.summary = _summary; /***/ 302: /***/ ((__unused_webpack_module, exports) => { -"use strict"; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -1118,7 +1110,6 @@ exports.toCommandProperties = toCommandProperties; /***/ 5236: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1228,7 +1219,6 @@ exports.getExecOutput = getExecOutput; /***/ 6665: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -1853,7 +1843,6 @@ class ExecState extends events.EventEmitter { /***/ 4552: /***/ (function(__unused_webpack_module, exports) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -1941,7 +1930,6 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ 4844: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; /* eslint-disable @typescript-eslint/no-explicit-any */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { @@ -2446,7 +2434,7 @@ class HttpClient { if (this._keepAlive && useProxy) { agent = this._proxyAgent; } - if (this._keepAlive && !useProxy) { + if (!useProxy) { agent = this._agent; } // if agent is already assigned use that agent. @@ -2478,16 +2466,12 @@ class HttpClient { agent = tunnelAgent(agentOptions); this._proxyAgent = agent; } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { + // if tunneling agent isn't assigned create a new agent + if (!agent) { const options = { keepAlive: this._keepAlive, maxSockets }; agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options @@ -2509,7 +2493,7 @@ class HttpClient { } const usingSsl = parsedUrl.protocol === 'https:'; proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { - token: `${proxyUrl.username}:${proxyUrl.password}` + token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}` }))); this._proxyAgentDispatcher = proxyAgent; if (usingSsl && this._ignoreSslError) { @@ -2604,7 +2588,6 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ 4988: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.checkBypass = exports.getProxyUrl = void 0; @@ -2623,11 +2606,11 @@ function getProxyUrl(reqUrl) { })(); if (proxyVar) { try { - return new URL(proxyVar); + return new DecodedURL(proxyVar); } catch (_a) { if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) - return new URL(`http://${proxyVar}`); + return new DecodedURL(`http://${proxyVar}`); } } else { @@ -2686,6 +2669,19 @@ function isLoopbackAddress(host) { hostLower.startsWith('[::1]') || hostLower.startsWith('[0:0:0:0:0:0:0:1]')); } +class DecodedURL extends URL { + constructor(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } +} //# sourceMappingURL=proxy.js.map /***/ }), @@ -2693,7 +2689,6 @@ function isLoopbackAddress(host) { /***/ 5207: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -2883,7 +2878,6 @@ exports.getCmdPath = getCmdPath; /***/ 4994: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -3197,7 +3191,6 @@ module.exports = __nccwpck_require__(218); /***/ 218: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; var net = __nccwpck_require__(9278); @@ -3469,7 +3462,6 @@ exports.debug = debug; // for test /***/ 6752: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Client = __nccwpck_require__(6197) @@ -3644,7 +3636,6 @@ module.exports.mockErrors = mockErrors /***/ 9965: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { InvalidArgumentError } = __nccwpck_require__(8707) @@ -3861,7 +3852,6 @@ module.exports = { /***/ 4660: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { AsyncResource } = __nccwpck_require__(290) @@ -3973,7 +3963,6 @@ module.exports = connect /***/ 6862: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -4230,7 +4219,6 @@ module.exports = pipeline /***/ 4043: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Readable = __nccwpck_require__(9927) @@ -4418,7 +4406,6 @@ module.exports.RequestHandler = RequestHandler /***/ 3560: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { finished, PassThrough } = __nccwpck_require__(2203) @@ -4646,7 +4633,6 @@ module.exports = stream /***/ 1882: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8707) @@ -4759,7 +4745,6 @@ module.exports = upgrade /***/ 6615: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; module.exports.request = __nccwpck_require__(4043) @@ -4774,7 +4759,6 @@ module.exports.connect = __nccwpck_require__(4660) /***/ 9927: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // Ported from https://github.com/nodejs/undici/pull/907 @@ -5157,7 +5141,6 @@ module.exports = { getResolveErrorBodyCallback } /***/ 1093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -5355,7 +5338,6 @@ module.exports = BalancedPool /***/ 479: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kConstruct } = __nccwpck_require__(296) @@ -6201,7 +6183,6 @@ module.exports = { /***/ 4738: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kConstruct } = __nccwpck_require__(296) @@ -6353,7 +6334,6 @@ module.exports = { /***/ 296: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; module.exports = { @@ -6366,7 +6346,6 @@ module.exports = { /***/ 3993: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const assert = __nccwpck_require__(2613) @@ -6423,7 +6402,6 @@ module.exports = { /***/ 6197: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // @ts-check @@ -8714,7 +8692,6 @@ module.exports = Client /***/ 3194: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* istanbul ignore file: only for Node 12 */ @@ -8770,7 +8747,6 @@ module.exports = function () { /***/ 9237: /***/ ((module) => { -"use strict"; // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size @@ -8790,11 +8766,10 @@ module.exports = { /***/ 3168: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { parseSetCookie } = __nccwpck_require__(8915) -const { stringify, getHeadersList } = __nccwpck_require__(3834) +const { stringify } = __nccwpck_require__(3834) const { webidl } = __nccwpck_require__(4222) const { Headers } = __nccwpck_require__(6349) @@ -8870,14 +8845,13 @@ function getSetCookies (headers) { webidl.brandCheck(headers, Headers, { strict: false }) - const cookies = getHeadersList(headers).cookies + const cookies = headers.getSetCookie() if (!cookies) { return [] } - // In older versions of undici, cookies is a list of name:value. - return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)) + return cookies.map((pair) => parseSetCookie(pair)) } /** @@ -8982,7 +8956,6 @@ module.exports = { /***/ 8915: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(9237) @@ -9305,14 +9278,14 @@ module.exports = { /***/ }), /***/ 3834: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; +/***/ ((module) => { -const assert = __nccwpck_require__(2613) -const { kHeadersList } = __nccwpck_require__(6443) +/** + * @param {string} value + * @returns {boolean} + */ function isCTLExcludingHtab (value) { if (value.length === 0) { return false @@ -9573,31 +9546,13 @@ function stringify (cookie) { return out.join('; ') } -let kHeadersListNode - -function getHeadersList (headers) { - if (headers[kHeadersList]) { - return headers[kHeadersList] - } - - if (!kHeadersListNode) { - kHeadersListNode = Object.getOwnPropertySymbols(headers).find( - (symbol) => symbol.description === 'headers list' - ) - - assert(kHeadersListNode, 'Headers cannot be parsed') - } - - const headersList = headers[kHeadersListNode] - assert(headersList) - - return headersList -} - module.exports = { isCTLExcludingHtab, - stringify, - getHeadersList + validateCookieName, + validateCookiePath, + validateCookieValue, + toIMFDate, + stringify } @@ -9606,7 +9561,6 @@ module.exports = { /***/ 9136: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const net = __nccwpck_require__(9278) @@ -9798,12 +9752,136 @@ function onConnectTimeout (socket) { module.exports = buildConnector +/***/ }), + +/***/ 735: +/***/ ((module) => { + + + +/** @type {Record} */ +const headerNameLowerCasedRecord = {} + +// https://developer.mozilla.org/docs/Web/HTTP/Headers +const wellknownHeaderNames = [ + 'Accept', + 'Accept-Encoding', + 'Accept-Language', + 'Accept-Ranges', + 'Access-Control-Allow-Credentials', + 'Access-Control-Allow-Headers', + 'Access-Control-Allow-Methods', + 'Access-Control-Allow-Origin', + 'Access-Control-Expose-Headers', + 'Access-Control-Max-Age', + 'Access-Control-Request-Headers', + 'Access-Control-Request-Method', + 'Age', + 'Allow', + 'Alt-Svc', + 'Alt-Used', + 'Authorization', + 'Cache-Control', + 'Clear-Site-Data', + 'Connection', + 'Content-Disposition', + 'Content-Encoding', + 'Content-Language', + 'Content-Length', + 'Content-Location', + 'Content-Range', + 'Content-Security-Policy', + 'Content-Security-Policy-Report-Only', + 'Content-Type', + 'Cookie', + 'Cross-Origin-Embedder-Policy', + 'Cross-Origin-Opener-Policy', + 'Cross-Origin-Resource-Policy', + 'Date', + 'Device-Memory', + 'Downlink', + 'ECT', + 'ETag', + 'Expect', + 'Expect-CT', + 'Expires', + 'Forwarded', + 'From', + 'Host', + 'If-Match', + 'If-Modified-Since', + 'If-None-Match', + 'If-Range', + 'If-Unmodified-Since', + 'Keep-Alive', + 'Last-Modified', + 'Link', + 'Location', + 'Max-Forwards', + 'Origin', + 'Permissions-Policy', + 'Pragma', + 'Proxy-Authenticate', + 'Proxy-Authorization', + 'RTT', + 'Range', + 'Referer', + 'Referrer-Policy', + 'Refresh', + 'Retry-After', + 'Sec-WebSocket-Accept', + 'Sec-WebSocket-Extensions', + 'Sec-WebSocket-Key', + 'Sec-WebSocket-Protocol', + 'Sec-WebSocket-Version', + 'Server', + 'Server-Timing', + 'Service-Worker-Allowed', + 'Service-Worker-Navigation-Preload', + 'Set-Cookie', + 'SourceMap', + 'Strict-Transport-Security', + 'Supports-Loading-Mode', + 'TE', + 'Timing-Allow-Origin', + 'Trailer', + 'Transfer-Encoding', + 'Upgrade', + 'Upgrade-Insecure-Requests', + 'User-Agent', + 'Vary', + 'Via', + 'WWW-Authenticate', + 'X-Content-Type-Options', + 'X-DNS-Prefetch-Control', + 'X-Frame-Options', + 'X-Permitted-Cross-Domain-Policies', + 'X-Powered-By', + 'X-Requested-With', + 'X-XSS-Protection' +] + +for (let i = 0; i < wellknownHeaderNames.length; ++i) { + const key = wellknownHeaderNames[i] + const lowerCasedKey = key.toLowerCase() + headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = + lowerCasedKey +} + +// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. +Object.setPrototypeOf(headerNameLowerCasedRecord, null) + +module.exports = { + wellknownHeaderNames, + headerNameLowerCasedRecord +} + + /***/ }), /***/ 8707: /***/ ((module) => { -"use strict"; class UndiciError extends Error { @@ -10041,7 +10119,6 @@ module.exports = { /***/ 4655: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -10618,7 +10695,6 @@ module.exports = { /***/ 3440: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const assert = __nccwpck_require__(2613) @@ -10630,6 +10706,7 @@ const { InvalidArgumentError } = __nccwpck_require__(8707) const { Blob } = __nccwpck_require__(181) const nodeUtil = __nccwpck_require__(9023) const { stringify } = __nccwpck_require__(3480) +const { headerNameLowerCasedRecord } = __nccwpck_require__(735) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) @@ -10839,6 +10916,15 @@ function parseKeepAliveTimeout (val) { return m ? parseInt(m[1], 10) * 1000 : null } +/** + * Retrieves a header name and returns its lowercase value. + * @param {string | Buffer} value Header name + * @returns {string} + */ +function headerNameToString (value) { + return headerNameLowerCasedRecord[value] || value.toLowerCase() +} + function parseHeaders (headers, obj = {}) { // For H2 support if (!Array.isArray(headers)) return headers @@ -11110,6 +11196,7 @@ module.exports = { isIterable, isAsyncIterable, isDestroyed, + headerNameToString, parseRawHeaders, parseHeaders, parseKeepAliveTimeout, @@ -11137,7 +11224,6 @@ module.exports = { /***/ 1: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Dispatcher = __nccwpck_require__(992) @@ -11337,7 +11423,6 @@ module.exports = DispatcherBase /***/ 992: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const EventEmitter = __nccwpck_require__(4434) @@ -11364,7 +11449,6 @@ module.exports = Dispatcher /***/ 8923: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Busboy = __nccwpck_require__(9581) @@ -11389,6 +11473,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(8253) const { File: UndiciFile } = __nccwpck_require__(3041) const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(4322) +let random +try { + const crypto = __nccwpck_require__(7598) + random = (max) => crypto.randomInt(0, max) +} catch { + random = (max) => Math.floor(Math.random(max)) +} + let ReadableStream = globalThis.ReadableStream /** @type {globalThis['File']} */ @@ -11474,7 +11566,7 @@ function extractBody (object, keepalive = false) { // Set source to a copy of the bytes held by object. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)) } else if (util.isFormDataLike(object)) { - const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}` + const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}` const prefix = `--${boundary}\r\nContent-Disposition: form-data` /*! formdata-polyfill. MIT License. Jimmy Wärting */ @@ -11977,7 +12069,6 @@ module.exports = { /***/ 7326: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(8167) @@ -12770,7 +12861,6 @@ module.exports = { /***/ 3041: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Blob, File: NativeFile } = __nccwpck_require__(181) @@ -13122,7 +13212,6 @@ module.exports = { File, FileLike, isFileLike } /***/ 3073: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(5523) @@ -13395,7 +13484,6 @@ module.exports = { FormData } /***/ 5628: /***/ ((module) => { -"use strict"; // In case of breaking changes, increase the version @@ -13443,7 +13531,6 @@ module.exports = { /***/ 6349: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // https://github.com/Ethan-Arrowood/undici-fetch @@ -13456,6 +13543,7 @@ const { isValidHeaderName, isValidHeaderValue } = __nccwpck_require__(5523) +const util = __nccwpck_require__(9023) const { webidl } = __nccwpck_require__(4222) const assert = __nccwpck_require__(2613) @@ -14009,6 +14097,9 @@ Object.defineProperties(Headers.prototype, { [Symbol.toStringTag]: { value: 'Headers', configurable: true + }, + [util.inspect.custom]: { + enumerable: false } }) @@ -14040,7 +14131,6 @@ module.exports = { /***/ 2315: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // https://github.com/Ethan-Arrowood/undici-fetch @@ -15246,6 +15336,9 @@ function httpRedirectFetch (fetchParams, response) { // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name request.headersList.delete('authorization') + // https://fetch.spec.whatwg.org/#authentication-entries + request.headersList.delete('proxy-authorization', true) + // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. request.headersList.delete('cookie') request.headersList.delete('host') @@ -16193,7 +16286,6 @@ module.exports = { /***/ 5194: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* globals AbortController */ @@ -17147,7 +17239,6 @@ module.exports = { Request, makeRequest } /***/ 8676: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Headers, HeadersList, fill } = __nccwpck_require__(6349) @@ -17726,7 +17817,6 @@ module.exports = { /***/ 9710: /***/ ((module) => { -"use strict"; module.exports = { @@ -17744,7 +17834,6 @@ module.exports = { /***/ 5523: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(7326) @@ -17754,14 +17843,18 @@ const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3440 const assert = __nccwpck_require__(2613) const { isUint8Array } = __nccwpck_require__(8253) +let supportedHashes = [] + // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable /** @type {import('crypto')|undefined} */ let crypto try { crypto = __nccwpck_require__(6982) + const possibleRelevantHashes = ['sha256', 'sha384', 'sha512'] + supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)) +/* c8 ignore next 3 */ } catch { - } function responseURL (response) { @@ -18289,66 +18382,56 @@ function bytesMatch (bytes, metadataList) { return true } - // 3. If parsedMetadata is the empty set, return true. + // 3. If response is not eligible for integrity validation, return false. + // TODO + + // 4. If parsedMetadata is the empty set, return true. if (parsedMetadata.length === 0) { return true } - // 4. Let metadata be the result of getting the strongest + // 5. Let metadata be the result of getting the strongest // metadata from parsedMetadata. - const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo)) - // get the strongest algorithm - const strongest = list[0].algo - // get all entries that use the strongest algorithm; ignore weaker - const metadata = list.filter((item) => item.algo === strongest) + const strongest = getStrongestMetadata(parsedMetadata) + const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest) - // 5. For each item in metadata: + // 6. For each item in metadata: for (const item of metadata) { // 1. Let algorithm be the alg component of item. const algorithm = item.algo // 2. Let expectedValue be the val component of item. - let expectedValue = item.hash + const expectedValue = item.hash // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e // "be liberal with padding". This is annoying, and it's not even in the spec. - if (expectedValue.endsWith('==')) { - expectedValue = expectedValue.slice(0, -2) - } - // 3. Let actualValue be the result of applying algorithm to bytes. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64') - if (actualValue.endsWith('==')) { - actualValue = actualValue.slice(0, -2) + if (actualValue[actualValue.length - 1] === '=') { + if (actualValue[actualValue.length - 2] === '=') { + actualValue = actualValue.slice(0, -2) + } else { + actualValue = actualValue.slice(0, -1) + } } // 4. If actualValue is a case-sensitive match for expectedValue, // return true. - if (actualValue === expectedValue) { - return true - } - - let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest('base64url') - - if (actualBase64URL.endsWith('==')) { - actualBase64URL = actualBase64URL.slice(0, -2) - } - - if (actualBase64URL === expectedValue) { + if (compareBase64Mixed(actualValue, expectedValue)) { return true } } - // 6. Return false. + // 7. Return false. return false } // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options // https://www.w3.org/TR/CSP2/#source-list-syntax // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 -const parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\x21-\x7e]?)?/i +const parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i /** * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata @@ -18362,8 +18445,6 @@ function parseMetadata (metadata) { // 2. Let empty be equal to true. let empty = true - const supportedHashes = crypto.getHashes() - // 3. For each token returned by splitting metadata on spaces: for (const token of metadata.split(' ')) { // 1. Set empty to false. @@ -18373,7 +18454,11 @@ function parseMetadata (metadata) { const parsedToken = parseHashWithOptions.exec(token) // 3. If token does not parse, continue to the next token. - if (parsedToken === null || parsedToken.groups === undefined) { + if ( + parsedToken === null || + parsedToken.groups === undefined || + parsedToken.groups.algo === undefined + ) { // Note: Chromium blocks the request at this point, but Firefox // gives a warning that an invalid integrity was given. The // correct behavior is to ignore these, and subsequently not @@ -18382,11 +18467,11 @@ function parseMetadata (metadata) { } // 4. Let algorithm be the hash-algo component of token. - const algorithm = parsedToken.groups.algo + const algorithm = parsedToken.groups.algo.toLowerCase() // 5. If algorithm is a hash function recognized by the user // agent, add the parsed token to result. - if (supportedHashes.includes(algorithm.toLowerCase())) { + if (supportedHashes.includes(algorithm)) { result.push(parsedToken.groups) } } @@ -18399,6 +18484,82 @@ function parseMetadata (metadata) { return result } +/** + * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList + */ +function getStrongestMetadata (metadataList) { + // Let algorithm be the algo component of the first item in metadataList. + // Can be sha256 + let algorithm = metadataList[0].algo + // If the algorithm is sha512, then it is the strongest + // and we can return immediately + if (algorithm[3] === '5') { + return algorithm + } + + for (let i = 1; i < metadataList.length; ++i) { + const metadata = metadataList[i] + // If the algorithm is sha512, then it is the strongest + // and we can break the loop immediately + if (metadata.algo[3] === '5') { + algorithm = 'sha512' + break + // If the algorithm is sha384, then a potential sha256 or sha384 is ignored + } else if (algorithm[3] === '3') { + continue + // algorithm is sha256, check if algorithm is sha384 and if so, set it as + // the strongest + } else if (metadata.algo[3] === '3') { + algorithm = 'sha384' + } + } + return algorithm +} + +function filterMetadataListByAlgorithm (metadataList, algorithm) { + if (metadataList.length === 1) { + return metadataList + } + + let pos = 0 + for (let i = 0; i < metadataList.length; ++i) { + if (metadataList[i].algo === algorithm) { + metadataList[pos++] = metadataList[i] + } + } + + metadataList.length = pos + + return metadataList +} + +/** + * Compares two base64 strings, allowing for base64url + * in the second string. + * +* @param {string} actualValue always base64 + * @param {string} expectedValue base64 or base64url + * @returns {boolean} + */ +function compareBase64Mixed (actualValue, expectedValue) { + if (actualValue.length !== expectedValue.length) { + return false + } + for (let i = 0; i < actualValue.length; ++i) { + if (actualValue[i] !== expectedValue[i]) { + if ( + (actualValue[i] === '+' && expectedValue[i] === '-') || + (actualValue[i] === '/' && expectedValue[i] === '_') + ) { + continue + } + return false + } + } + + return true +} + // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) { // TODO @@ -18814,7 +18975,8 @@ module.exports = { urlHasHttpsScheme, urlIsHttpHttpsScheme, readAllBytes, - normalizeMethodRecord + normalizeMethodRecord, + parseMetadata } @@ -18823,7 +18985,6 @@ module.exports = { /***/ 4222: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { types } = __nccwpck_require__(9023) @@ -19477,7 +19638,6 @@ module.exports = { /***/ 396: /***/ ((module) => { -"use strict"; /** @@ -19775,7 +19935,6 @@ module.exports = { /***/ 2160: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -20127,7 +20286,6 @@ module.exports = { /***/ 5976: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(4222) @@ -20213,7 +20371,6 @@ module.exports = { /***/ 6812: /***/ ((module) => { -"use strict"; module.exports = { @@ -20231,7 +20388,6 @@ module.exports = { /***/ 165: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -20631,7 +20787,6 @@ module.exports = { /***/ 2581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // We include a version number for the Dispatcher API. In case of breaking changes, @@ -20671,7 +20826,6 @@ module.exports = { /***/ 8840: /***/ ((module) => { -"use strict"; module.exports = class DecoratorHandler { @@ -20714,7 +20868,6 @@ module.exports = class DecoratorHandler { /***/ 8299: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const util = __nccwpck_require__(3440) @@ -20901,12 +21054,17 @@ function parseLocation (statusCode, headers) { // https://tools.ietf.org/html/rfc7231#section-6.4.4 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') - ) + if (header.length === 4) { + return util.headerNameToString(header) === 'host' + } + if (removeContent && util.headerNameToString(header).startsWith('content-')) { + return true + } + if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { + const name = util.headerNameToString(header) + return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization' + } + return false } // https://tools.ietf.org/html/rfc7231#section-6.4 @@ -21281,7 +21439,6 @@ module.exports = RetryHandler /***/ 4415: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const RedirectHandler = __nccwpck_require__(8299) @@ -21310,7 +21467,6 @@ module.exports = createRedirectInterceptor /***/ 2824: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; @@ -21611,7 +21767,6 @@ module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn /***/ 172: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.enumToMap = void 0; @@ -21633,7 +21788,6 @@ exports.enumToMap = enumToMap; /***/ 7501: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kClients } = __nccwpck_require__(6443) @@ -21812,7 +21966,6 @@ module.exports = MockAgent /***/ 7365: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { promisify } = __nccwpck_require__(9023) @@ -21879,7 +22032,6 @@ module.exports = MockClient /***/ 2429: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { UndiciError } = __nccwpck_require__(8707) @@ -21904,7 +22056,6 @@ module.exports = { /***/ 1511: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3397) @@ -22118,7 +22269,6 @@ module.exports.MockScope = MockScope /***/ 4004: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { promisify } = __nccwpck_require__(9023) @@ -22185,7 +22335,6 @@ module.exports = MockPool /***/ 1117: /***/ ((module) => { -"use strict"; module.exports = { @@ -22216,7 +22365,6 @@ module.exports = { /***/ 3397: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { MockNotMatchedError } = __nccwpck_require__(2429) @@ -22575,7 +22723,6 @@ module.exports = { /***/ 6142: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Transform } = __nccwpck_require__(2203) @@ -22623,7 +22770,6 @@ module.exports = class PendingInterceptorsFormatter { /***/ 1529: /***/ ((module) => { -"use strict"; const singulars = { @@ -22660,7 +22806,6 @@ module.exports = class Pluralizer { /***/ 4869: /***/ ((module) => { -"use strict"; /* eslint-disable */ @@ -22785,7 +22930,6 @@ module.exports = class FixedQueue { /***/ 8640: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const DispatcherBase = __nccwpck_require__(1) @@ -23028,7 +23172,6 @@ module.exports = PoolStats /***/ 5076: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -23104,6 +23247,20 @@ class Pool extends PoolBase { ? { ...options.interceptors } : undefined this[kFactory] = factory + + this.on('connectionError', (origin, targets, error) => { + // If a connection error occurs, we remove the client from the pool, + // and emit a connectionError event. They will not be re-used. + // Fixes https://github.com/nodejs/undici/issues/3895 + for (const target of targets) { + // Do not use kRemoveClient here, as it will close the client, + // but the client cannot be closed in this state. + const idx = this[kClients].indexOf(target) + if (idx !== -1) { + this[kClients].splice(idx, 1) + } + } + }) } [kGetDispatcher] () { @@ -23130,7 +23287,6 @@ module.exports = Pool /***/ 2720: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(6443) @@ -23327,7 +23483,6 @@ module.exports = ProxyAgent /***/ 8804: /***/ ((module) => { -"use strict"; let fastNow = Date.now() @@ -23432,7 +23587,6 @@ module.exports = { /***/ 8550: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const diagnosticsChannel = __nccwpck_require__(1637) @@ -23731,7 +23885,6 @@ module.exports = { /***/ 5913: /***/ ((module) => { -"use strict"; // This is a Globally Unique Identifier unique used @@ -23790,7 +23943,6 @@ module.exports = { /***/ 6255: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(4222) @@ -24101,7 +24253,6 @@ module.exports = { /***/ 1237: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { maxUnsigned16Bit } = __nccwpck_require__(5913) @@ -24182,7 +24333,6 @@ module.exports = { /***/ 3171: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Writable } = __nccwpck_require__(2203) @@ -24534,7 +24684,6 @@ module.exports = { /***/ 2933: /***/ ((module) => { -"use strict"; module.exports = { @@ -24554,7 +24703,6 @@ module.exports = { /***/ 3574: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(2933) @@ -24762,7 +24910,6 @@ module.exports = { /***/ 5171: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(4222) @@ -25411,247 +25558,223 @@ module.exports = { /***/ 2613: /***/ ((module) => { -"use strict"; -module.exports = require("assert"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert"); /***/ }), /***/ 290: /***/ ((module) => { -"use strict"; -module.exports = require("async_hooks"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("async_hooks"); /***/ }), /***/ 181: /***/ ((module) => { -"use strict"; -module.exports = require("buffer"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer"); /***/ }), /***/ 5317: /***/ ((module) => { -"use strict"; -module.exports = require("child_process"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process"); /***/ }), /***/ 4236: /***/ ((module) => { -"use strict"; -module.exports = require("console"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("console"); /***/ }), /***/ 6982: /***/ ((module) => { -"use strict"; -module.exports = require("crypto"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto"); /***/ }), /***/ 1637: /***/ ((module) => { -"use strict"; -module.exports = require("diagnostics_channel"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("diagnostics_channel"); /***/ }), /***/ 4434: /***/ ((module) => { -"use strict"; -module.exports = require("events"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events"); /***/ }), /***/ 9896: /***/ ((module) => { -"use strict"; -module.exports = require("fs"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); /***/ }), /***/ 8611: /***/ ((module) => { -"use strict"; -module.exports = require("http"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); /***/ }), /***/ 5675: /***/ ((module) => { -"use strict"; -module.exports = require("http2"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2"); /***/ }), /***/ 5692: /***/ ((module) => { -"use strict"; -module.exports = require("https"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); /***/ }), /***/ 9278: /***/ ((module) => { -"use strict"; -module.exports = require("net"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); + +/***/ }), + +/***/ 7598: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto"); /***/ }), /***/ 8474: /***/ ((module) => { -"use strict"; -module.exports = require("node:events"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events"); /***/ }), /***/ 7075: /***/ ((module) => { -"use strict"; -module.exports = require("node:stream"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream"); /***/ }), /***/ 7975: /***/ ((module) => { -"use strict"; -module.exports = require("node:util"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util"); /***/ }), /***/ 857: /***/ ((module) => { -"use strict"; -module.exports = require("os"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); /***/ }), /***/ 6928: /***/ ((module) => { -"use strict"; -module.exports = require("path"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); /***/ }), /***/ 2987: /***/ ((module) => { -"use strict"; -module.exports = require("perf_hooks"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("perf_hooks"); /***/ }), /***/ 3480: /***/ ((module) => { -"use strict"; -module.exports = require("querystring"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring"); /***/ }), /***/ 2203: /***/ ((module) => { -"use strict"; -module.exports = require("stream"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream"); /***/ }), /***/ 3774: /***/ ((module) => { -"use strict"; -module.exports = require("stream/web"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream/web"); /***/ }), /***/ 3193: /***/ ((module) => { -"use strict"; -module.exports = require("string_decoder"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder"); /***/ }), /***/ 3557: /***/ ((module) => { -"use strict"; -module.exports = require("timers"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("timers"); /***/ }), /***/ 4756: /***/ ((module) => { -"use strict"; -module.exports = require("tls"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); /***/ }), /***/ 7016: /***/ ((module) => { -"use strict"; -module.exports = require("url"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url"); /***/ }), /***/ 9023: /***/ ((module) => { -"use strict"; -module.exports = require("util"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); /***/ }), /***/ 8253: /***/ ((module) => { -"use strict"; -module.exports = require("util/types"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util/types"); /***/ }), /***/ 8167: /***/ ((module) => { -"use strict"; -module.exports = require("worker_threads"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("worker_threads"); /***/ }), /***/ 3106: /***/ ((module) => { -"use strict"; -module.exports = require("zlib"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib"); /***/ }), /***/ 7182: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const WritableStream = (__nccwpck_require__(7075).Writable) @@ -25732,7 +25855,7 @@ Dicer.prototype._write = function (data, encoding, cb) { if (this._headerFirst && this._isPreamble) { if (!this._part) { this._part = new PartStream(this._partOpts) - if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() } + if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() } } const r = this._hparser.push(data) if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } @@ -25789,7 +25912,7 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) { } } if (this._dashes === 2) { - if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) } + if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) } this.reset() this._finished = true // no more parts will be added @@ -25807,7 +25930,13 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) { this._part._read = function (n) { self._unpause() } - if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() } + if (this._isPreamble && this.listenerCount('preamble') !== 0) { + this.emit('preamble', this._part) + } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) { + this.emit('part', this._part) + } else { + this._ignore() + } if (!this._isPreamble) { this._inHeader = true } } if (data && start < end && !this._ignoreData) { @@ -25866,7 +25995,6 @@ module.exports = Dicer /***/ 2271: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const EventEmitter = (__nccwpck_require__(8474).EventEmitter) @@ -25974,7 +26102,6 @@ module.exports = HeaderParser /***/ 612: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const inherits = (__nccwpck_require__(7975).inherits) @@ -25995,7 +26122,6 @@ module.exports = PartStream /***/ 4136: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /** @@ -26231,7 +26357,6 @@ module.exports = SBMH /***/ 9581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const WritableStream = (__nccwpck_require__(7075).Writable) @@ -26324,7 +26449,6 @@ module.exports.Dicer = Dicer /***/ 1192: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // TODO: @@ -26490,7 +26614,7 @@ function Multipart (boy, cfg) { ++nfiles - if (!boy._events.file) { + if (boy.listenerCount('file') === 0) { self.parser._ignore() return } @@ -26638,7 +26762,6 @@ module.exports = Multipart /***/ 855: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Decoder = __nccwpck_require__(1496) @@ -26836,7 +26959,6 @@ module.exports = UrlEncoded /***/ 1496: /***/ ((module) => { -"use strict"; const RE_PLUS = /\+/g @@ -26898,7 +27020,6 @@ module.exports = Decoder /***/ 692: /***/ ((module) => { -"use strict"; module.exports = function basename (path) { @@ -26920,7 +27041,6 @@ module.exports = function basename (path) { /***/ 2747: /***/ (function(module) { -"use strict"; // Node has always utf-8 @@ -27019,7 +27139,7 @@ const decoders = { if (textDecoders.has(this.toString())) { try { return textDecoders.get(this).decode(data) - } catch (e) { } + } catch {} } return typeof data === 'string' ? data @@ -27042,7 +27162,6 @@ module.exports = decodeText /***/ 2393: /***/ ((module) => { -"use strict"; module.exports = function getLimit (limits, name, defaultLimit) { @@ -27066,7 +27185,6 @@ module.exports = function getLimit (limits, name, defaultLimit) { /***/ 8929: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* eslint-disable object-property-newline */ @@ -27267,52 +27385,55 @@ module.exports = parseParams /***/ }) -/******/ }); +/******/ }); /************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __nccwpck_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ var threw = true; -/******/ try { -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); -/******/ threw = false; -/******/ } finally { -/******/ if(threw) delete __webpack_module_cache__[moduleId]; -/******/ } -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nccwpck_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } -/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ var threw = true; +/******/ try { +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete __webpack_module_cache__[moduleId]; +/******/ } +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ /************************************************************************/ -/******/ /* webpack/runtime/compat */ -/******/ -/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; -/******/ +/******/ /* webpack/runtime/compat */ +/******/ +/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; +/******/ /************************************************************************/ var __webpack_exports__ = {}; -const core = __nccwpck_require__(7484); -const fs = (__nccwpck_require__(9896).promises); -const { execFile } = __nccwpck_require__(5317); +/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(7484); +/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(9896); +/* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(5317); + + + const workspacePath = process.env.GITHUB_WORKSPACE; -const options = core.getMultilineInput("options"); -const path = core.getInput("path"); +const options = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("options"); +const path = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput("path"); let repoError; let platformError; @@ -27322,26 +27443,26 @@ async function run() { if (process.platform === "win32") { let workspaceExists; try { - await fs.access(workspacePath); + await fs__WEBPACK_IMPORTED_MODULE_1__.promises.access(workspacePath); workspaceExists = true; } catch { workspaceExists = false; } - const workspaceNotEmpty = (await fs.readdir(workspacePath)).length > 0; + const workspaceNotEmpty = (await fs__WEBPACK_IMPORTED_MODULE_1__.promises.readdir(workspacePath)).length > 0; if (workspaceExists && workspaceNotEmpty) { const escapedOptions = options.map((str) => str.replace(/(["'])/g, "$1"), ); - execFile( + (0,child_process__WEBPACK_IMPORTED_MODULE_2__.execFile)( `${process.env["ProgramFiles(x86)"]}\\Inno Setup 6\\iscc.exe`, [...escapedOptions, `${workspacePath}\\${path}`], (execError, stdout, stderr) => { console.log(stdout, stderr); if (execError) { - core.setFailed(`Execution failed with error: ${stderr}`); + _actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(`Execution failed with error: ${stderr}`); process.exit(execError.code || 1); } }, @@ -27355,13 +27476,10 @@ async function run() { throw new Error("This action is only supported on Windows!"); } } catch (error) { - core.setFailed(error.message); + _actions_core__WEBPACK_IMPORTED_MODULE_0__.setFailed(error.message); process.exit(1); } } run(); -module.exports = __webpack_exports__; -/******/ })() -; \ No newline at end of file diff --git a/dist/package.json b/dist/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/dist/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +}