Skip to content

Commit

Permalink
Merge pull request #44 from hashicorp-forge/dependabot/npm_and_yarn/a…
Browse files Browse the repository at this point in the history
…xios-1.6.0

Bump axios from 1.5.1 to 1.6.0
  • Loading branch information
brandonc authored Nov 1, 2023
2 parents 64a5a70 + d9b228f commit 12116f0
Show file tree
Hide file tree
Showing 5 changed files with 341 additions and 171 deletions.
39 changes: 26 additions & 13 deletions dist/apply/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.1";
const VERSION = "1.6.0";
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseProtocol.js


Expand Down Expand Up @@ -9142,6 +9142,18 @@ const wrapAsync = (asyncExecutor) => {
})
};

const resolveFamily = ({address, family}) => {
if (!utils.isString(address)) {
throw TypeError('address must be a string');
}
return ({
address,
family: family || (address.indexOf('.') < 0 ? 6 : 4)
});
}

const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});

/*eslint consistent-return:0*/
/* harmony default export */ const http = (isHttpAdapterSupported && function httpAdapter(config) {
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
Expand All @@ -9152,15 +9164,16 @@ const wrapAsync = (asyncExecutor) => {
let rejected = false;
let req;

if (lookup && utils.isAsyncFn(lookup)) {
lookup = helpers_callbackify(lookup, (entry) => {
if(utils.isString(entry)) {
entry = [entry, entry.indexOf('.') < 0 ? 6 : 4]
} else if (!utils.isArray(entry)) {
throw new TypeError('lookup async function must return an array [ip: string, family: number]]')
}
return entry;
})
if (lookup) {
const _lookup = helpers_callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);
// hotfix to support opt.all option which is required for node 20.x
lookup = (hostname, opt, cb) => {
_lookup(hostname, opt, (err, arg0, arg1) => {
const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];

opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
});
}
}

// temporary internal emitter until the AxiosRequest class will be implemented
Expand Down Expand Up @@ -9565,7 +9578,7 @@ const wrapAsync = (asyncExecutor) => {
}
response.data = responseData;
} catch (err) {
reject(core_AxiosError.from(err, null, config, response.request, response));
return reject(core_AxiosError.from(err, null, config, response.request, response));
}
settle(resolve, reject, response);
});
Expand Down Expand Up @@ -9979,8 +9992,8 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
// Specifically not if we're in a web worker, or react-native.
if (node.isStandardBrowserEnv) {
// Add xsrf header
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName);
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);

if (xsrfValue) {
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
Expand Down
39 changes: 26 additions & 13 deletions dist/destroy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.1";
const VERSION = "1.6.0";
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseProtocol.js


Expand Down Expand Up @@ -9142,6 +9142,18 @@ const wrapAsync = (asyncExecutor) => {
})
};

const resolveFamily = ({address, family}) => {
if (!utils.isString(address)) {
throw TypeError('address must be a string');
}
return ({
address,
family: family || (address.indexOf('.') < 0 ? 6 : 4)
});
}

const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});

/*eslint consistent-return:0*/
/* harmony default export */ const http = (isHttpAdapterSupported && function httpAdapter(config) {
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
Expand All @@ -9152,15 +9164,16 @@ const wrapAsync = (asyncExecutor) => {
let rejected = false;
let req;

if (lookup && utils.isAsyncFn(lookup)) {
lookup = helpers_callbackify(lookup, (entry) => {
if(utils.isString(entry)) {
entry = [entry, entry.indexOf('.') < 0 ? 6 : 4]
} else if (!utils.isArray(entry)) {
throw new TypeError('lookup async function must return an array [ip: string, family: number]]')
}
return entry;
})
if (lookup) {
const _lookup = helpers_callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);
// hotfix to support opt.all option which is required for node 20.x
lookup = (hostname, opt, cb) => {
_lookup(hostname, opt, (err, arg0, arg1) => {
const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];

opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
});
}
}

// temporary internal emitter until the AxiosRequest class will be implemented
Expand Down Expand Up @@ -9565,7 +9578,7 @@ const wrapAsync = (asyncExecutor) => {
}
response.data = responseData;
} catch (err) {
reject(core_AxiosError.from(err, null, config, response.request, response));
return reject(core_AxiosError.from(err, null, config, response.request, response));
}
settle(resolve, reject, response);
});
Expand Down Expand Up @@ -9979,8 +9992,8 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
// Specifically not if we're in a web worker, or react-native.
if (node.isStandardBrowserEnv) {
// Add xsrf header
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName);
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);

if (xsrfValue) {
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
Expand Down
39 changes: 26 additions & 13 deletions dist/outputs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.1";
const VERSION = "1.6.0";
;// CONCATENATED MODULE: ./node_modules/axios/lib/helpers/parseProtocol.js


Expand Down Expand Up @@ -9165,6 +9165,18 @@ const wrapAsync = (asyncExecutor) => {
})
};

const resolveFamily = ({address, family}) => {
if (!utils.isString(address)) {
throw TypeError('address must be a string');
}
return ({
address,
family: family || (address.indexOf('.') < 0 ? 6 : 4)
});
}

const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});

/*eslint consistent-return:0*/
/* harmony default export */ const http = (isHttpAdapterSupported && function httpAdapter(config) {
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
Expand All @@ -9175,15 +9187,16 @@ const wrapAsync = (asyncExecutor) => {
let rejected = false;
let req;

if (lookup && utils.isAsyncFn(lookup)) {
lookup = helpers_callbackify(lookup, (entry) => {
if(utils.isString(entry)) {
entry = [entry, entry.indexOf('.') < 0 ? 6 : 4]
} else if (!utils.isArray(entry)) {
throw new TypeError('lookup async function must return an array [ip: string, family: number]]')
}
return entry;
})
if (lookup) {
const _lookup = helpers_callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);
// hotfix to support opt.all option which is required for node 20.x
lookup = (hostname, opt, cb) => {
_lookup(hostname, opt, (err, arg0, arg1) => {
const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];

opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
});
}
}

// temporary internal emitter until the AxiosRequest class will be implemented
Expand Down Expand Up @@ -9588,7 +9601,7 @@ const wrapAsync = (asyncExecutor) => {
}
response.data = responseData;
} catch (err) {
reject(core_AxiosError.from(err, null, config, response.request, response));
return reject(core_AxiosError.from(err, null, config, response.request, response));
}
settle(resolve, reject, response);
});
Expand Down Expand Up @@ -10002,8 +10015,8 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
// Specifically not if we're in a web worker, or react-native.
if (node.isStandardBrowserEnv) {
// Add xsrf header
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName);
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);

if (xsrfValue) {
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
Expand Down
Loading

0 comments on commit 12116f0

Please sign in to comment.