axios 1.6.4 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of axios might be problematic. Click here for more details.
- package/CHANGELOG.md +26 -0
- package/README.md +6 -1
- package/dist/axios.js +366 -3
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +24 -3
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +24 -3
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +30 -5
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +1 -1
- package/index.d.ts +1 -1
- package/lib/adapters/http.js +6 -2
- package/lib/core/Axios.js +22 -1
- package/lib/env/data.js +1 -1
- package/package.json +1 -1
package/dist/node/axios.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.6.
|
1
|
+
// Axios v1.6.6 Copyright (c) 2024 Matt Zabriskie and contributors
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
const FormData$1 = require('form-data');
|
@@ -2022,7 +2022,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
2022
2022
|
return requestedURL;
|
2023
2023
|
}
|
2024
2024
|
|
2025
|
-
const VERSION = "1.6.
|
2025
|
+
const VERSION = "1.6.6";
|
2026
2026
|
|
2027
2027
|
function parseProtocol(url) {
|
2028
2028
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
@@ -2535,12 +2535,12 @@ const supportedProtocols = platform.protocols.map(protocol => {
|
|
2535
2535
|
*
|
2536
2536
|
* @returns {Object<string, any>}
|
2537
2537
|
*/
|
2538
|
-
function dispatchBeforeRedirect(options) {
|
2538
|
+
function dispatchBeforeRedirect(options, responseDetails) {
|
2539
2539
|
if (options.beforeRedirects.proxy) {
|
2540
2540
|
options.beforeRedirects.proxy(options);
|
2541
2541
|
}
|
2542
2542
|
if (options.beforeRedirects.config) {
|
2543
|
-
options.beforeRedirects.config(options);
|
2543
|
+
options.beforeRedirects.config(options, responseDetails);
|
2544
2544
|
}
|
2545
2545
|
}
|
2546
2546
|
|
@@ -2653,6 +2653,10 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
2653
2653
|
// hotfix to support opt.all option which is required for node 20.x
|
2654
2654
|
lookup = (hostname, opt, cb) => {
|
2655
2655
|
_lookup(hostname, opt, (err, arg0, arg1) => {
|
2656
|
+
if (err) {
|
2657
|
+
return cb(err);
|
2658
|
+
}
|
2659
|
+
|
2656
2660
|
const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
2657
2661
|
|
2658
2662
|
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
@@ -3866,7 +3870,28 @@ class Axios {
|
|
3866
3870
|
*
|
3867
3871
|
* @returns {Promise} The Promise to be fulfilled
|
3868
3872
|
*/
|
3869
|
-
request(configOrUrl, config) {
|
3873
|
+
async request(configOrUrl, config) {
|
3874
|
+
try {
|
3875
|
+
return await this._request(configOrUrl, config);
|
3876
|
+
} catch (err) {
|
3877
|
+
const dummy = {};
|
3878
|
+
if (Error.captureStackTrace) {
|
3879
|
+
Error.captureStackTrace(dummy);
|
3880
|
+
} else {
|
3881
|
+
dummy.stack = new Error().stack;
|
3882
|
+
}
|
3883
|
+
// slice off the Error: ... line
|
3884
|
+
dummy.stack = dummy.stack.replace(/^.+\n/, '');
|
3885
|
+
// match without the 2 top stack lines
|
3886
|
+
if (!err.stack.endsWith(dummy.stack.replace(/^.+\n.+\n/, ''))) {
|
3887
|
+
err.stack += '\n' + dummy.stack;
|
3888
|
+
}
|
3889
|
+
|
3890
|
+
throw err;
|
3891
|
+
}
|
3892
|
+
}
|
3893
|
+
|
3894
|
+
_request(configOrUrl, config) {
|
3870
3895
|
/*eslint no-param-reassign:0*/
|
3871
3896
|
// Allow for axios('example/url'[, config]) a la fetch API
|
3872
3897
|
if (typeof configOrUrl === 'string') {
|