axios 1.7.9 → 1.8.1
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 +61 -0
- package/README.md +30 -14
- package/dist/axios.js +13 -24
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +2 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +13 -27
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +13 -27
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +2 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +42 -29
- package/dist/node/axios.cjs.map +1 -1
- package/lib/core/Axios.js +10 -1
- package/lib/core/buildFullPath.js +3 -2
- package/lib/env/data.js +1 -1
- package/lib/helpers/formDataToStream.js +3 -2
- package/lib/platform/node/index.js +26 -0
- package/lib/utils.js +0 -22
- package/package.json +3 -3
- package/SECURITY.md +0 -6
package/dist/browser/axios.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
/*! Axios v1.8.1 Copyright (c) 2025 Matt Zabriskie and contributors */
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
function bind(fn, thisArg) {
|
@@ -607,26 +607,6 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
607
607
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
608
608
|
};
|
609
609
|
|
610
|
-
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
611
|
-
|
612
|
-
const DIGIT = '0123456789';
|
613
|
-
|
614
|
-
const ALPHABET = {
|
615
|
-
DIGIT,
|
616
|
-
ALPHA,
|
617
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
618
|
-
};
|
619
|
-
|
620
|
-
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
621
|
-
let str = '';
|
622
|
-
const {length} = alphabet;
|
623
|
-
while (size--) {
|
624
|
-
str += alphabet[Math.random() * length|0];
|
625
|
-
}
|
626
|
-
|
627
|
-
return str;
|
628
|
-
};
|
629
|
-
|
630
610
|
/**
|
631
611
|
* If the thing is a FormData object, return true, otherwise return false.
|
632
612
|
*
|
@@ -754,8 +734,6 @@ var utils$1 = {
|
|
754
734
|
findKey,
|
755
735
|
global: _global,
|
756
736
|
isContextDefined,
|
757
|
-
ALPHABET,
|
758
|
-
generateString,
|
759
737
|
isSpecCompliantForm,
|
760
738
|
toJSONObject,
|
761
739
|
isAsyncFn,
|
@@ -2248,8 +2226,9 @@ function combineURLs(baseURL, relativeURL) {
|
|
2248
2226
|
*
|
2249
2227
|
* @returns {string} The combined full path
|
2250
2228
|
*/
|
2251
|
-
function buildFullPath(baseURL, requestedURL) {
|
2252
|
-
|
2229
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
2230
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
2231
|
+
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
|
2253
2232
|
return combineURLs(baseURL, requestedURL);
|
2254
2233
|
}
|
2255
2234
|
return requestedURL;
|
@@ -3089,7 +3068,7 @@ function dispatchRequest(config) {
|
|
3089
3068
|
});
|
3090
3069
|
}
|
3091
3070
|
|
3092
|
-
const VERSION = "1.
|
3071
|
+
const VERSION = "1.8.1";
|
3093
3072
|
|
3094
3073
|
const validators$1 = {};
|
3095
3074
|
|
@@ -3274,6 +3253,13 @@ class Axios {
|
|
3274
3253
|
}
|
3275
3254
|
}
|
3276
3255
|
|
3256
|
+
// Set config.allowAbsoluteUrls
|
3257
|
+
if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
3258
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
3259
|
+
} else {
|
3260
|
+
config.allowAbsoluteUrls = true;
|
3261
|
+
}
|
3262
|
+
|
3277
3263
|
validator.assertOptions(config, {
|
3278
3264
|
baseUrl: validators.spelling('baseURL'),
|
3279
3265
|
withXsrfToken: validators.spelling('withXSRFToken')
|
@@ -3369,7 +3355,7 @@ class Axios {
|
|
3369
3355
|
|
3370
3356
|
getUri(config) {
|
3371
3357
|
config = mergeConfig(this.defaults, config);
|
3372
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
3358
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
3373
3359
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
3374
3360
|
}
|
3375
3361
|
}
|