2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

chore(release): v1.8.0 (#6795)

Co-authored-by: jasonsaayman <4814473+jasonsaayman@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2025-02-26 08:00:31 +02:00
committed by GitHub
parent 23a25af068
commit cceb7b1e15
17 changed files with 153 additions and 47 deletions
+19 -7
View File
@@ -1,6 +1,7 @@
// Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors
/*! Axios v1.8.0 Copyright (c) 2025 Matt Zabriskie and contributors */
'use strict';
const crypto = require('crypto');
const FormData$1 = require('form-data');
const url = require('url');
const proxyFromEnv = require('proxy-from-env');
@@ -14,6 +15,7 @@ const events = require('events');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
const crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv);
@@ -643,8 +645,10 @@ const ALPHABET = {
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
let str = '';
const {length} = alphabet;
while (size--) {
str += alphabet[Math.random() * length|0];
const randomValues = new Uint32Array(size);
crypto__default["default"].randomFillSync(randomValues);
for (let i = 0; i < size; i++) {
str += alphabet[randomValues[i] % length];
}
return str;
@@ -2071,14 +2075,15 @@ function combineURLs(baseURL, relativeURL) {
*
* @returns {string} The combined full path
*/
function buildFullPath(baseURL, requestedURL) {
if (baseURL && !isAbsoluteURL(requestedURL)) {
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
let isRelativeUrl = !isAbsoluteURL(requestedURL);
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
return combineURLs(baseURL, requestedURL);
}
return requestedURL;
}
const VERSION = "1.7.9";
const VERSION = "1.8.0";
function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -4304,6 +4309,13 @@ class Axios {
}
}
// Set config.allowAbsoluteUrls
if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
} else {
config.allowAbsoluteUrls = true;
}
validator.assertOptions(config, {
baseUrl: validators.spelling('baseURL'),
withXsrfToken: validators.spelling('withXSRFToken')
@@ -4399,7 +4411,7 @@ class Axios {
getUri(config) {
config = mergeConfig(this.defaults, config);
const fullPath = buildFullPath(config.baseURL, config.url);
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
return buildURL(fullPath, config.params, config.paramsSerializer);
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long