2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +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
+50
View File
@@ -1,5 +1,55 @@
# Changelog # Changelog
# [1.8.0](https://github.com/axios/axios/compare/v1.7.9...v1.8.0) (2025-02-25)
### Bug Fixes
* **examples:** application crashed when navigating examples in browser ([#5938](https://github.com/axios/axios/issues/5938)) ([1260ded](https://github.com/axios/axios/commit/1260ded634ec101dd5ed05d3b70f8e8f899dba6c))
* missing word in SUPPORT_QUESTION.yml ([#6757](https://github.com/axios/axios/issues/6757)) ([1f890b1](https://github.com/axios/axios/commit/1f890b13f2c25a016f3c84ae78efb769f244133e))
* **utils:** replace getRandomValues with crypto module ([#6788](https://github.com/axios/axios/issues/6788)) ([23a25af](https://github.com/axios/axios/commit/23a25af0688d1db2c396deb09229d2271cc24f6c))
### Features
* Add config for ignoring absolute URLs ([#5902](https://github.com/axios/axios/issues/5902)) ([#6192](https://github.com/axios/axios/issues/6192)) ([32c7bcc](https://github.com/axios/axios/commit/32c7bcc0f233285ba27dec73a4b1e81fb7a219b3))
### Reverts
* Revert "chore: expose fromDataToStream to be consumable (#6731)" (#6732) ([1317261](https://github.com/axios/axios/commit/1317261125e9c419fe9f126867f64d28f9c1efda)), closes [#6731](https://github.com/axios/axios/issues/6731) [#6732](https://github.com/axios/axios/issues/6732)
### BREAKING CHANGES
* code relying on the above will now combine the URLs instead of prefer request URL
* feat: add config option for allowing absolute URLs
* fix: add default value for allowAbsoluteUrls in buildFullPath
* fix: typo in flow control when setting allowAbsoluteUrls
### Contributors to this release
- <img src="https://avatars.githubusercontent.com/u/7661715?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Toscano](https://github.com/GethosTheWalrus "+42/-8 (#6192 )")
- <img src="https://avatars.githubusercontent.com/u/22686401?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+26/-3 (#6788 #6777 )")
- <img src="https://avatars.githubusercontent.com/u/72578270?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Naron](https://github.com/naronchen "+27/-0 (#5901 )")
- <img src="https://avatars.githubusercontent.com/u/47430686?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [shravan || श्रvan](https://github.com/shravan20 "+7/-3 (#6116 )")
- <img src="https://avatars.githubusercontent.com/u/145078271?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Justin Dhillon](https://github.com/justindhillon "+0/-7 (#6312 )")
- <img src="https://avatars.githubusercontent.com/u/30925732?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [yionr](https://github.com/yionr "+5/-1 (#6129 )")
- <img src="https://avatars.githubusercontent.com/u/534166?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shin&#x27;ya Ueoka](https://github.com/ueokande "+3/-3 (#5935 )")
- <img src="https://avatars.githubusercontent.com/u/33569?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dan Dascalescu](https://github.com/dandv "+3/-3 (#5908 #6757 )")
- <img src="https://avatars.githubusercontent.com/u/16476523?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Nitin Ramnani](https://github.com/NitinRamnani "+2/-2 (#5938 )")
- <img src="https://avatars.githubusercontent.com/u/152275799?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shay Molcho](https://github.com/shaymolcho "+2/-2 (#6770 )")
- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+0/-3 (#6732 )")
- fancy45daddy
- <img src="https://avatars.githubusercontent.com/u/127725897?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Habip Akyol](https://github.com/habipakyol "+1/-1 (#6030 )")
- <img src="https://avatars.githubusercontent.com/u/54869395?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Bailey Lissington](https://github.com/llamington "+1/-1 (#6771 )")
- <img src="https://avatars.githubusercontent.com/u/14969290?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Bernardo da Eira Duarte](https://github.com/bernardoduarte "+1/-1 (#6480 )")
- <img src="https://avatars.githubusercontent.com/u/117800149?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shivam Batham](https://github.com/Shivam-Batham "+1/-1 (#5949 )")
- <img src="https://avatars.githubusercontent.com/u/67861627?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Lipin Kariappa](https://github.com/lipinnnnn "+1/-1 (#5936 )")
## [1.7.9](https://github.com/axios/axios/compare/v1.7.8...v1.7.9) (2024-12-04) ## [1.7.9](https://github.com/axios/axios/compare/v1.7.8...v1.7.9) (2024-12-04)
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "axios", "name": "axios",
"main": "./dist/axios.js", "main": "./dist/axios.js",
"version": "1.7.9", "version": "1.8.0",
"homepage": "https://axios-http.com", "homepage": "https://axios-http.com",
"authors": [ "authors": [
"Matt Zabriskie" "Matt Zabriskie"
+25 -11
View File
@@ -1,9 +1,13 @@
// Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors /*! Axios v1.8.0 Copyright (c) 2025 Matt Zabriskie and contributors */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('crypto')) :
typeof define === 'function' && define.amd ? define(factory) : typeof define === 'function' && define.amd ? define(['crypto'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory()); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory(global.crypto));
})(this, (function () { 'use strict'; })(this, (function (crypto) { 'use strict';
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
function _AsyncGenerator(e) { function _AsyncGenerator(e) {
var r, t; var r, t;
@@ -1278,8 +1282,10 @@
var alphabet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ALPHABET.ALPHA_DIGIT; var alphabet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ALPHABET.ALPHA_DIGIT;
var str = ''; var str = '';
var length = alphabet.length; var length = alphabet.length;
while (size--) { var randomValues = new Uint32Array(size);
str += alphabet[Math.random() * length | 0]; crypto__default["default"].randomFillSync(randomValues);
for (var i = 0; i < size; i++) {
str += alphabet[randomValues[i] % length];
} }
return str; return str;
}; };
@@ -2720,8 +2726,9 @@
* *
* @returns {string} The combined full path * @returns {string} The combined full path
*/ */
function buildFullPath(baseURL, requestedURL) { function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
if (baseURL && !isAbsoluteURL(requestedURL)) { var isRelativeUrl = !isAbsoluteURL(requestedURL);
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
return combineURLs(baseURL, requestedURL); return combineURLs(baseURL, requestedURL);
} }
return requestedURL; return requestedURL;
@@ -3676,7 +3683,7 @@
}); });
} }
var VERSION = "1.7.9"; var VERSION = "1.8.0";
var validators$1 = {}; var validators$1 = {};
@@ -3867,6 +3874,13 @@
}, true); }, true);
} }
} }
// 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, { validator.assertOptions(config, {
baseUrl: validators.spelling('baseURL'), baseUrl: validators.spelling('baseURL'),
withXsrfToken: validators.spelling('withXSRFToken') withXsrfToken: validators.spelling('withXSRFToken')
@@ -3939,7 +3953,7 @@
key: "getUri", key: "getUri",
value: function getUri(config) { value: function getUri(config) {
config = mergeConfig(this.defaults, config); config = mergeConfig(this.defaults, config);
var fullPath = buildFullPath(config.baseURL, config.url); var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
return buildURL(fullPath, config.params, config.paramsSerializer); return buildURL(fullPath, config.params, config.paramsSerializer);
} }
}]); }]);
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+23 -7
View File
@@ -1,6 +1,12 @@
// Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors /*! Axios v1.8.0 Copyright (c) 2025 Matt Zabriskie and contributors */
'use strict'; 'use strict';
var crypto = require('crypto');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
function bind(fn, thisArg) { function bind(fn, thisArg) {
return function wrap() { return function wrap() {
return fn.apply(thisArg, arguments); return fn.apply(thisArg, arguments);
@@ -620,8 +626,10 @@ const ALPHABET = {
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
let str = ''; let str = '';
const {length} = alphabet; const {length} = alphabet;
while (size--) { const randomValues = new Uint32Array(size);
str += alphabet[Math.random() * length|0]; crypto__default["default"].randomFillSync(randomValues);
for (let i = 0; i < size; i++) {
str += alphabet[randomValues[i] % length];
} }
return str; return str;
@@ -2248,8 +2256,9 @@ function combineURLs(baseURL, relativeURL) {
* *
* @returns {string} The combined full path * @returns {string} The combined full path
*/ */
function buildFullPath(baseURL, requestedURL) { function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
if (baseURL && !isAbsoluteURL(requestedURL)) { let isRelativeUrl = !isAbsoluteURL(requestedURL);
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
return combineURLs(baseURL, requestedURL); return combineURLs(baseURL, requestedURL);
} }
return requestedURL; return requestedURL;
@@ -3089,7 +3098,7 @@ function dispatchRequest(config) {
}); });
} }
const VERSION = "1.7.9"; const VERSION = "1.8.0";
const validators$1 = {}; const validators$1 = {};
@@ -3274,6 +3283,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, { validator.assertOptions(config, {
baseUrl: validators.spelling('baseURL'), baseUrl: validators.spelling('baseURL'),
withXsrfToken: validators.spelling('withXSRFToken') withXsrfToken: validators.spelling('withXSRFToken')
@@ -3369,7 +3385,7 @@ class Axios {
getUri(config) { getUri(config) {
config = mergeConfig(this.defaults, 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); return buildURL(fullPath, config.params, config.paramsSerializer);
} }
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+19 -7
View File
@@ -1,4 +1,6 @@
// Axios v1.7.9 Copyright (c) 2024 Matt Zabriskie and contributors /*! Axios v1.8.0 Copyright (c) 2025 Matt Zabriskie and contributors */
import crypto from 'crypto';
function bind(fn, thisArg) { function bind(fn, thisArg) {
return function wrap() { return function wrap() {
return fn.apply(thisArg, arguments); return fn.apply(thisArg, arguments);
@@ -618,8 +620,10 @@ const ALPHABET = {
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
let str = ''; let str = '';
const {length} = alphabet; const {length} = alphabet;
while (size--) { const randomValues = new Uint32Array(size);
str += alphabet[Math.random() * length|0]; crypto.randomFillSync(randomValues);
for (let i = 0; i < size; i++) {
str += alphabet[randomValues[i] % length];
} }
return str; return str;
@@ -2246,8 +2250,9 @@ function combineURLs(baseURL, relativeURL) {
* *
* @returns {string} The combined full path * @returns {string} The combined full path
*/ */
function buildFullPath(baseURL, requestedURL) { function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
if (baseURL && !isAbsoluteURL(requestedURL)) { let isRelativeUrl = !isAbsoluteURL(requestedURL);
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
return combineURLs(baseURL, requestedURL); return combineURLs(baseURL, requestedURL);
} }
return requestedURL; return requestedURL;
@@ -3087,7 +3092,7 @@ function dispatchRequest(config) {
}); });
} }
const VERSION$1 = "1.7.9"; const VERSION$1 = "1.8.0";
const validators$1 = {}; const validators$1 = {};
@@ -3272,6 +3277,13 @@ class Axios$1 {
} }
} }
// 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, { validator.assertOptions(config, {
baseUrl: validators.spelling('baseURL'), baseUrl: validators.spelling('baseURL'),
withXsrfToken: validators.spelling('withXSRFToken') withXsrfToken: validators.spelling('withXSRFToken')
@@ -3367,7 +3379,7 @@ class Axios$1 {
getUri(config) { getUri(config) {
config = mergeConfig$1(this.defaults, config); config = mergeConfig$1(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); return buildURL(fullPath, config.params, config.paramsSerializer);
} }
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+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'; 'use strict';
const crypto = require('crypto');
const FormData$1 = require('form-data'); const FormData$1 = require('form-data');
const url = require('url'); const url = require('url');
const proxyFromEnv = require('proxy-from-env'); 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 }; } 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 FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
const url__default = /*#__PURE__*/_interopDefaultLegacy(url); const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv); const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv);
@@ -643,8 +645,10 @@ const ALPHABET = {
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
let str = ''; let str = '';
const {length} = alphabet; const {length} = alphabet;
while (size--) { const randomValues = new Uint32Array(size);
str += alphabet[Math.random() * length|0]; crypto__default["default"].randomFillSync(randomValues);
for (let i = 0; i < size; i++) {
str += alphabet[randomValues[i] % length];
} }
return str; return str;
@@ -2071,14 +2075,15 @@ function combineURLs(baseURL, relativeURL) {
* *
* @returns {string} The combined full path * @returns {string} The combined full path
*/ */
function buildFullPath(baseURL, requestedURL) { function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
if (baseURL && !isAbsoluteURL(requestedURL)) { let isRelativeUrl = !isAbsoluteURL(requestedURL);
if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
return combineURLs(baseURL, requestedURL); return combineURLs(baseURL, requestedURL);
} }
return requestedURL; return requestedURL;
} }
const VERSION = "1.7.9"; const VERSION = "1.8.0";
function parseProtocol(url) { function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(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, { validator.assertOptions(config, {
baseUrl: validators.spelling('baseURL'), baseUrl: validators.spelling('baseURL'),
withXsrfToken: validators.spelling('withXSRFToken') withXsrfToken: validators.spelling('withXSRFToken')
@@ -4399,7 +4411,7 @@ class Axios {
getUri(config) { getUri(config) {
config = mergeConfig(this.defaults, 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); return buildURL(fullPath, config.params, config.paramsSerializer);
} }
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "1.7.9"; export const VERSION = "1.8.0";
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "axios", "name": "axios",
"version": "1.7.9", "version": "1.8.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "axios", "name": "axios",
"version": "1.7.9", "version": "1.8.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.6", "follow-redirects": "^1.15.6",
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "axios", "name": "axios",
"version": "1.7.9", "version": "1.8.0",
"description": "Promise based HTTP client for the browser and node.js", "description": "Promise based HTTP client for the browser and node.js",
"main": "index.js", "main": "index.js",
"exports": { "exports": {
@@ -163,12 +163,12 @@
"Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)", "Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)",
"Jay (https://github.com/jasonsaayman)", "Jay (https://github.com/jasonsaayman)",
"Emily Morehouse (https://github.com/emilyemorehouse)", "Emily Morehouse (https://github.com/emilyemorehouse)",
"Justin Beckwith (https://github.com/JustinBeckwith)",
"Rubén Norte (https://github.com/rubennorte)", "Rubén Norte (https://github.com/rubennorte)",
"Justin Beckwith (https://github.com/JustinBeckwith)",
"Martti Laine (https://github.com/codeclown)", "Martti Laine (https://github.com/codeclown)",
"Xianming Zhong (https://github.com/chinesedfan)", "Xianming Zhong (https://github.com/chinesedfan)",
"Remco Haszing (https://github.com/remcohaszing)",
"Rikki Gibson (https://github.com/RikkiGibson)", "Rikki Gibson (https://github.com/RikkiGibson)",
"Remco Haszing (https://github.com/remcohaszing)",
"Yasu Flores (https://github.com/yasuf)", "Yasu Flores (https://github.com/yasuf)",
"Ben Carp (https://github.com/carpben)" "Ben Carp (https://github.com/carpben)"
], ],