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/lib/core/Axios.js CHANGED
@@ -97,6 +97,15 @@ class Axios {
97
97
  }
98
98
  }
99
99
 
100
+ // Set config.allowAbsoluteUrls
101
+ if (config.allowAbsoluteUrls !== undefined) {
102
+ // do nothing
103
+ } else if (this.defaults.allowAbsoluteUrls !== undefined) {
104
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
105
+ } else {
106
+ config.allowAbsoluteUrls = true;
107
+ }
108
+
100
109
  validator.assertOptions(config, {
101
110
  baseUrl: validators.spelling('baseURL'),
102
111
  withXsrfToken: validators.spelling('withXSRFToken')
@@ -192,7 +201,7 @@ class Axios {
192
201
 
193
202
  getUri(config) {
194
203
  config = mergeConfig(this.defaults, config);
195
- const fullPath = buildFullPath(config.baseURL, config.url);
204
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
196
205
  return buildURL(fullPath, config.params, config.paramsSerializer);
197
206
  }
198
207
  }
@@ -13,8 +13,9 @@ import combineURLs from '../helpers/combineURLs.js';
13
13
  *
14
14
  * @returns {string} The combined full path
15
15
  */
16
- export default function buildFullPath(baseURL, requestedURL) {
17
- if (baseURL && !isAbsoluteURL(requestedURL)) {
16
+ export default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
17
+ let isRelativeUrl = !isAbsoluteURL(requestedURL);
18
+ if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
18
19
  return combineURLs(baseURL, requestedURL);
19
20
  }
20
21
  return requestedURL;
package/lib/env/data.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.7.9";
1
+ export const VERSION = "1.8.0";
package/lib/utils.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  import bind from './helpers/bind.js';
4
+ import crypto from 'crypto';
4
5
 
5
6
  // utils is a library of generic helper functions non-specific to axios
6
7
 
@@ -615,8 +616,10 @@ const ALPHABET = {
615
616
  const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
616
617
  let str = '';
617
618
  const {length} = alphabet;
618
- while (size--) {
619
- str += alphabet[Math.random() * length|0]
619
+ const randomValues = new Uint32Array(size);
620
+ crypto.randomFillSync(randomValues);
621
+ for (let i = 0; i < size; i++) {
622
+ str += alphabet[randomValues[i] % length];
620
623
  }
621
624
 
622
625
  return str;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "1.7.9",
3
+ "version": "1.8.0",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -163,12 +163,12 @@
163
163
  "Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)",
164
164
  "Jay (https://github.com/jasonsaayman)",
165
165
  "Emily Morehouse (https://github.com/emilyemorehouse)",
166
- "Justin Beckwith (https://github.com/JustinBeckwith)",
167
166
  "Rubén Norte (https://github.com/rubennorte)",
167
+ "Justin Beckwith (https://github.com/JustinBeckwith)",
168
168
  "Martti Laine (https://github.com/codeclown)",
169
169
  "Xianming Zhong (https://github.com/chinesedfan)",
170
- "Remco Haszing (https://github.com/remcohaszing)",
171
170
  "Rikki Gibson (https://github.com/RikkiGibson)",
171
+ "Remco Haszing (https://github.com/remcohaszing)",
172
172
  "Yasu Flores (https://github.com/yasuf)",
173
173
  "Ben Carp (https://github.com/carpben)"
174
174
  ],
package/SECURITY.md DELETED
@@ -1,6 +0,0 @@
1
- # Reporting a Vulnerability
2
-
3
- If you discover a security vulnerability in axios please disclose it via [our huntr page](https://huntr.dev/repos/axios/axios/). Bounty eligibility, CVE assignment, response times and past reports are all there.
4
-
5
-
6
- Thank you for improving the security of axios.