From 2e2ba8d0eb1200353854723b2ea6a940a044fbef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:21:07 +0000 Subject: [PATCH 1/2] Bump axios from 1.5.0 to 1.5.1 Bumps [axios](https://github.com/axios/axios) from 1.5.0 to 1.5.1. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.5.0...v1.5.1) --- updated-dependencies: - dependency-name: axios dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c01389..d9ccd9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@actions/core": "^1.10.1", "@actions/exec": "^1.1.1", - "axios": "^1.5.0", + "axios": "^1.5.1", "axios-retry": "^3.8.0" }, "devDependencies": { @@ -1281,9 +1281,9 @@ } }, "node_modules/axios": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", - "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -5980,9 +5980,9 @@ "dev": true }, "axios": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", - "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", diff --git a/package.json b/package.json index a0f0ffa..e9ae51a 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dependencies": { "@actions/core": "^1.10.1", "@actions/exec": "^1.1.1", - "axios": "^1.5.0", + "axios": "^1.5.1", "axios-retry": "^3.8.0" }, "devDependencies": { From 2e41c6acec5b29d9500a66628d99e42d06eb9561 Mon Sep 17 00:00:00 2001 From: Brandon Croft Date: Mon, 2 Oct 2023 09:29:39 -0600 Subject: [PATCH 2/2] Rebuild after bump --- dist/apply/index.js | 65 +++++++++++++++++++++++++++++-------------- dist/destroy/index.js | 65 +++++++++++++++++++++++++++++-------------- dist/outputs/index.js | 65 +++++++++++++++++++++++++++++-------------- 3 files changed, 132 insertions(+), 63 deletions(-) diff --git a/dist/apply/index.js b/dist/apply/index.js index 1656470..18e7dde 100644 --- a/dist/apply/index.js +++ b/dist/apply/index.js @@ -7823,7 +7823,7 @@ const defaults = { transitional: defaults_transitional, - adapter: node.isNode ? 'http' : 'xhr', + adapter: ['xhr', 'http'], transformRequest: [function transformRequest(data, headers) { const contentType = headers.getContentType() || ''; @@ -8464,7 +8464,7 @@ var follow_redirects = __nccwpck_require__(7707); ;// CONCATENATED MODULE: external "zlib" const external_zlib_namespaceObject = require("zlib"); ;// CONCATENATED MODULE: ./node_modules/axios/lib/env/data.js -const VERSION = "1.5.0"; +const VERSION = "1.5.1"; ;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseProtocol.js @@ -9469,7 +9469,7 @@ const wrapAsync = (asyncExecutor) => { delete res.headers['content-encoding']; } - switch (res.headers['content-encoding']) { + switch ((res.headers['content-encoding'] || '').toLowerCase()) { /*eslint default-case:0*/ case 'gzip': case 'x-gzip': @@ -9602,7 +9602,7 @@ const wrapAsync = (asyncExecutor) => { // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. const timeout = parseInt(config.timeout, 10); - if (isNaN(timeout)) { + if (Number.isNaN(timeout)) { reject(new core_AxiosError( 'error trying to parse `config.timeout` to int', core_AxiosError.ERR_BAD_OPTION_VALUE, @@ -9852,11 +9852,16 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; } } + let contentType; + if (utils.isFormData(requestData)) { if (node.isStandardBrowserEnv || node.isStandardBrowserWebWorkerEnv) { requestHeaders.setContentType(false); // Let the browser set it - } else { - requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks + } else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){ + requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks + } else if(utils.isString(contentType = requestHeaders.getContentType())){ + // fix semicolon duplication issue for ReactNative FormData implementation + requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1')) } } @@ -10055,7 +10060,7 @@ const knownAdapters = { } utils.forEach(knownAdapters, (fn, value) => { - if(fn) { + if (fn) { try { Object.defineProperty(fn, 'name', {value}); } catch (e) { @@ -10065,6 +10070,10 @@ utils.forEach(knownAdapters, (fn, value) => { } }); +const renderReason = (reason) => `- ${reason}`; + +const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; + /* harmony default export */ const adapters = ({ getAdapter: (adapters) => { adapters = utils.isArray(adapters) ? adapters : [adapters]; @@ -10073,30 +10082,44 @@ utils.forEach(knownAdapters, (fn, value) => { let nameOrAdapter; let adapter; + const rejectedReasons = {}; + for (let i = 0; i < length; i++) { nameOrAdapter = adapters[i]; - if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new core_AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter) { break; } + + rejectedReasons[id || '#' + i] = adapter; } if (!adapter) { - if (adapter === false) { - throw new core_AxiosError( - `Adapter ${nameOrAdapter} is not supported by the environment`, - 'ERR_NOT_SUPPORT' + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') ); - } - throw new Error( - utils.hasOwnProp(knownAdapters, nameOrAdapter) ? - `Adapter '${nameOrAdapter}' is not available in the build` : - `Unknown adapter '${nameOrAdapter}'` - ); - } + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; - if (!utils.isFunction(adapter)) { - throw new TypeError('adapter is not a function'); + throw new core_AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); } return adapter; diff --git a/dist/destroy/index.js b/dist/destroy/index.js index 6071f00..a68fe26 100644 --- a/dist/destroy/index.js +++ b/dist/destroy/index.js @@ -7823,7 +7823,7 @@ const defaults = { transitional: defaults_transitional, - adapter: node.isNode ? 'http' : 'xhr', + adapter: ['xhr', 'http'], transformRequest: [function transformRequest(data, headers) { const contentType = headers.getContentType() || ''; @@ -8464,7 +8464,7 @@ var follow_redirects = __nccwpck_require__(7707); ;// CONCATENATED MODULE: external "zlib" const external_zlib_namespaceObject = require("zlib"); ;// CONCATENATED MODULE: ./node_modules/axios/lib/env/data.js -const VERSION = "1.5.0"; +const VERSION = "1.5.1"; ;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseProtocol.js @@ -9469,7 +9469,7 @@ const wrapAsync = (asyncExecutor) => { delete res.headers['content-encoding']; } - switch (res.headers['content-encoding']) { + switch ((res.headers['content-encoding'] || '').toLowerCase()) { /*eslint default-case:0*/ case 'gzip': case 'x-gzip': @@ -9602,7 +9602,7 @@ const wrapAsync = (asyncExecutor) => { // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. const timeout = parseInt(config.timeout, 10); - if (isNaN(timeout)) { + if (Number.isNaN(timeout)) { reject(new core_AxiosError( 'error trying to parse `config.timeout` to int', core_AxiosError.ERR_BAD_OPTION_VALUE, @@ -9852,11 +9852,16 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; } } + let contentType; + if (utils.isFormData(requestData)) { if (node.isStandardBrowserEnv || node.isStandardBrowserWebWorkerEnv) { requestHeaders.setContentType(false); // Let the browser set it - } else { - requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks + } else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){ + requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks + } else if(utils.isString(contentType = requestHeaders.getContentType())){ + // fix semicolon duplication issue for ReactNative FormData implementation + requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1')) } } @@ -10055,7 +10060,7 @@ const knownAdapters = { } utils.forEach(knownAdapters, (fn, value) => { - if(fn) { + if (fn) { try { Object.defineProperty(fn, 'name', {value}); } catch (e) { @@ -10065,6 +10070,10 @@ utils.forEach(knownAdapters, (fn, value) => { } }); +const renderReason = (reason) => `- ${reason}`; + +const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; + /* harmony default export */ const adapters = ({ getAdapter: (adapters) => { adapters = utils.isArray(adapters) ? adapters : [adapters]; @@ -10073,30 +10082,44 @@ utils.forEach(knownAdapters, (fn, value) => { let nameOrAdapter; let adapter; + const rejectedReasons = {}; + for (let i = 0; i < length; i++) { nameOrAdapter = adapters[i]; - if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new core_AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter) { break; } + + rejectedReasons[id || '#' + i] = adapter; } if (!adapter) { - if (adapter === false) { - throw new core_AxiosError( - `Adapter ${nameOrAdapter} is not supported by the environment`, - 'ERR_NOT_SUPPORT' + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') ); - } - throw new Error( - utils.hasOwnProp(knownAdapters, nameOrAdapter) ? - `Adapter '${nameOrAdapter}' is not available in the build` : - `Unknown adapter '${nameOrAdapter}'` - ); - } + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; - if (!utils.isFunction(adapter)) { - throw new TypeError('adapter is not a function'); + throw new core_AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); } return adapter; diff --git a/dist/outputs/index.js b/dist/outputs/index.js index fa28937..8c666ee 100644 --- a/dist/outputs/index.js +++ b/dist/outputs/index.js @@ -7846,7 +7846,7 @@ const defaults = { transitional: defaults_transitional, - adapter: node.isNode ? 'http' : 'xhr', + adapter: ['xhr', 'http'], transformRequest: [function transformRequest(data, headers) { const contentType = headers.getContentType() || ''; @@ -8487,7 +8487,7 @@ var follow_redirects = __nccwpck_require__(7707); ;// CONCATENATED MODULE: external "zlib" const external_zlib_namespaceObject = require("zlib"); ;// CONCATENATED MODULE: ./node_modules/axios/lib/env/data.js -const VERSION = "1.5.0"; +const VERSION = "1.5.1"; ;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseProtocol.js @@ -9492,7 +9492,7 @@ const wrapAsync = (asyncExecutor) => { delete res.headers['content-encoding']; } - switch (res.headers['content-encoding']) { + switch ((res.headers['content-encoding'] || '').toLowerCase()) { /*eslint default-case:0*/ case 'gzip': case 'x-gzip': @@ -9625,7 +9625,7 @@ const wrapAsync = (asyncExecutor) => { // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. const timeout = parseInt(config.timeout, 10); - if (isNaN(timeout)) { + if (Number.isNaN(timeout)) { reject(new core_AxiosError( 'error trying to parse `config.timeout` to int', core_AxiosError.ERR_BAD_OPTION_VALUE, @@ -9875,11 +9875,16 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; } } + let contentType; + if (utils.isFormData(requestData)) { if (node.isStandardBrowserEnv || node.isStandardBrowserWebWorkerEnv) { requestHeaders.setContentType(false); // Let the browser set it - } else { - requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks + } else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){ + requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks + } else if(utils.isString(contentType = requestHeaders.getContentType())){ + // fix semicolon duplication issue for ReactNative FormData implementation + requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1')) } } @@ -10078,7 +10083,7 @@ const knownAdapters = { } utils.forEach(knownAdapters, (fn, value) => { - if(fn) { + if (fn) { try { Object.defineProperty(fn, 'name', {value}); } catch (e) { @@ -10088,6 +10093,10 @@ utils.forEach(knownAdapters, (fn, value) => { } }); +const renderReason = (reason) => `- ${reason}`; + +const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; + /* harmony default export */ const adapters = ({ getAdapter: (adapters) => { adapters = utils.isArray(adapters) ? adapters : [adapters]; @@ -10096,30 +10105,44 @@ utils.forEach(knownAdapters, (fn, value) => { let nameOrAdapter; let adapter; + const rejectedReasons = {}; + for (let i = 0; i < length; i++) { nameOrAdapter = adapters[i]; - if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) { + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new core_AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter) { break; } + + rejectedReasons[id || '#' + i] = adapter; } if (!adapter) { - if (adapter === false) { - throw new core_AxiosError( - `Adapter ${nameOrAdapter} is not supported by the environment`, - 'ERR_NOT_SUPPORT' + + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') ); - } - throw new Error( - utils.hasOwnProp(knownAdapters, nameOrAdapter) ? - `Adapter '${nameOrAdapter}' is not available in the build` : - `Unknown adapter '${nameOrAdapter}'` - ); - } + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; - if (!utils.isFunction(adapter)) { - throw new TypeError('adapter is not a function'); + throw new core_AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); } return adapter;