axios 1.7.9 → 1.8.0

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,6 @@
1
- // Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors
1
+ /*! Axios v1.8.0 Copyright (c) 2025 Matt Zabriskie and contributors */
2
+ import crypto from 'crypto';
3
+
2
4
  function bind(fn, thisArg) {
3
5
  return function wrap() {
4
6
  return fn.apply(thisArg, arguments);
@@ -618,8 +620,10 @@ const ALPHABET = {
618
620
  const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
619
621
  let str = '';
620
622
  const {length} = alphabet;
621
- while (size--) {
622
- str += alphabet[Math.random() * length|0];
623
+ const randomValues = new Uint32Array(size);
624
+ crypto.randomFillSync(randomValues);
625
+ for (let i = 0; i < size; i++) {
626
+ str += alphabet[randomValues[i] % length];
623
627
  }
624
628
 
625
629
  return str;
@@ -2246,8 +2250,9 @@ function combineURLs(baseURL, relativeURL) {
2246
2250
  *
2247
2251
  * @returns {string} The combined full path
2248
2252
  */
2249
- function buildFullPath(baseURL, requestedURL) {
2250
- if (baseURL && !isAbsoluteURL(requestedURL)) {
2253
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2254
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
2255
+ if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
2251
2256
  return combineURLs(baseURL, requestedURL);
2252
2257
  }
2253
2258
  return requestedURL;
@@ -3087,7 +3092,7 @@ function dispatchRequest(config) {
3087
3092
  });
3088
3093
  }
3089
3094
 
3090
- const VERSION$1 = "1.7.9";
3095
+ const VERSION$1 = "1.8.0";
3091
3096
 
3092
3097
  const validators$1 = {};
3093
3098
 
@@ -3272,6 +3277,13 @@ class Axios$1 {
3272
3277
  }
3273
3278
  }
3274
3279
 
3280
+ // Set config.allowAbsoluteUrls
3281
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
3282
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
3283
+ } else {
3284
+ config.allowAbsoluteUrls = true;
3285
+ }
3286
+
3275
3287
  validator.assertOptions(config, {
3276
3288
  baseUrl: validators.spelling('baseURL'),
3277
3289
  withXsrfToken: validators.spelling('withXSRFToken')
@@ -3367,7 +3379,7 @@ class Axios$1 {
3367
3379
 
3368
3380
  getUri(config) {
3369
3381
  config = mergeConfig$1(this.defaults, config);
3370
- const fullPath = buildFullPath(config.baseURL, config.url);
3382
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3371
3383
  return buildURL(fullPath, config.params, config.paramsSerializer);
3372
3384
  }
3373
3385
  }