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/dist/esm/axios.js CHANGED
@@ -1,4 +1,4 @@
1
- // Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors
1
+ /*! Axios v1.8.1 Copyright (c) 2025 Matt Zabriskie and contributors */
2
2
  function bind(fn, thisArg) {
3
3
  return function wrap() {
4
4
  return fn.apply(thisArg, arguments);
@@ -605,26 +605,6 @@ const toFiniteNumber = (value, defaultValue) => {
605
605
  return value != null && Number.isFinite(value = +value) ? value : defaultValue;
606
606
  };
607
607
 
608
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
609
-
610
- const DIGIT = '0123456789';
611
-
612
- const ALPHABET = {
613
- DIGIT,
614
- ALPHA,
615
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
616
- };
617
-
618
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
619
- let str = '';
620
- const {length} = alphabet;
621
- while (size--) {
622
- str += alphabet[Math.random() * length|0];
623
- }
624
-
625
- return str;
626
- };
627
-
628
608
  /**
629
609
  * If the thing is a FormData object, return true, otherwise return false.
630
610
  *
@@ -752,8 +732,6 @@ const utils$1 = {
752
732
  findKey,
753
733
  global: _global,
754
734
  isContextDefined,
755
- ALPHABET,
756
- generateString,
757
735
  isSpecCompliantForm,
758
736
  toJSONObject,
759
737
  isAsyncFn,
@@ -2246,8 +2224,9 @@ function combineURLs(baseURL, relativeURL) {
2246
2224
  *
2247
2225
  * @returns {string} The combined full path
2248
2226
  */
2249
- function buildFullPath(baseURL, requestedURL) {
2250
- if (baseURL && !isAbsoluteURL(requestedURL)) {
2227
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2228
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
2229
+ if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
2251
2230
  return combineURLs(baseURL, requestedURL);
2252
2231
  }
2253
2232
  return requestedURL;
@@ -3087,7 +3066,7 @@ function dispatchRequest(config) {
3087
3066
  });
3088
3067
  }
3089
3068
 
3090
- const VERSION$1 = "1.7.9";
3069
+ const VERSION$1 = "1.8.1";
3091
3070
 
3092
3071
  const validators$1 = {};
3093
3072
 
@@ -3272,6 +3251,13 @@ class Axios$1 {
3272
3251
  }
3273
3252
  }
3274
3253
 
3254
+ // Set config.allowAbsoluteUrls
3255
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
3256
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
3257
+ } else {
3258
+ config.allowAbsoluteUrls = true;
3259
+ }
3260
+
3275
3261
  validator.assertOptions(config, {
3276
3262
  baseUrl: validators.spelling('baseURL'),
3277
3263
  withXsrfToken: validators.spelling('withXSRFToken')
@@ -3367,7 +3353,7 @@ class Axios$1 {
3367
3353
 
3368
3354
  getUri(config) {
3369
3355
  config = mergeConfig$1(this.defaults, config);
3370
- const fullPath = buildFullPath(config.baseURL, config.url);
3356
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3371
3357
  return buildURL(fullPath, config.params, config.paramsSerializer);
3372
3358
  }
3373
3359
  }