axios 1.6.6 → 1.6.8
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 +31 -0
- package/README.md +5 -2
- package/dist/axios.js +322 -299
- 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 +17 -17
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +17 -17
- 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 +19 -20
- package/dist/node/axios.cjs.map +1 -1
- package/lib/adapters/http.js +1 -1
- package/lib/core/Axios.js +14 -11
- package/lib/core/mergeConfig.js +1 -1
- package/lib/defaults/index.js +0 -3
- package/lib/env/data.js +1 -1
- package/package.json +25 -25
package/dist/esm/axios.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.6.
|
1
|
+
// Axios v1.6.8 Copyright (c) 2024 Matt Zabriskie and contributors
|
2
2
|
function bind(fn, thisArg) {
|
3
3
|
return function wrap() {
|
4
4
|
return fn.apply(thisArg, arguments);
|
@@ -1436,9 +1436,6 @@ const defaults = {
|
|
1436
1436
|
const isFormData = utils$1.isFormData(data);
|
1437
1437
|
|
1438
1438
|
if (isFormData) {
|
1439
|
-
if (!hasJSONContentType) {
|
1440
|
-
return data;
|
1441
|
-
}
|
1442
1439
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
1443
1440
|
}
|
1444
1441
|
|
@@ -2554,7 +2551,7 @@ function dispatchRequest(config) {
|
|
2554
2551
|
});
|
2555
2552
|
}
|
2556
2553
|
|
2557
|
-
const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? thing
|
2554
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? { ...thing } : thing;
|
2558
2555
|
|
2559
2556
|
/**
|
2560
2557
|
* Config-specific merge-function which creates a new config-object
|
@@ -2656,7 +2653,7 @@ function mergeConfig$1(config1, config2) {
|
|
2656
2653
|
return config;
|
2657
2654
|
}
|
2658
2655
|
|
2659
|
-
const VERSION$1 = "1.6.
|
2656
|
+
const VERSION$1 = "1.6.8";
|
2660
2657
|
|
2661
2658
|
const validators$1 = {};
|
2662
2659
|
|
@@ -2775,17 +2772,20 @@ class Axios$1 {
|
|
2775
2772
|
try {
|
2776
2773
|
return await this._request(configOrUrl, config);
|
2777
2774
|
} catch (err) {
|
2778
|
-
|
2779
|
-
|
2780
|
-
|
2781
|
-
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2775
|
+
if (err instanceof Error) {
|
2776
|
+
let dummy;
|
2777
|
+
|
2778
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
|
2779
|
+
|
2780
|
+
// slice off the Error: ... line
|
2781
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
2782
|
+
|
2783
|
+
if (!err.stack) {
|
2784
|
+
err.stack = stack;
|
2785
|
+
// match without the 2 top stack lines
|
2786
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
2787
|
+
err.stack += '\n' + stack;
|
2788
|
+
}
|
2789
2789
|
}
|
2790
2790
|
|
2791
2791
|
throw err;
|