mirror of
https://github.com/axios/axios.git
synced 2026-04-11 14:21:59 +08:00
chore(release): v1.9.0 (#6891)
Co-authored-by: DigitalBrainJS <12586868+DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
parent
987d2e2dd3
commit
cdcfd214c1
27
CHANGELOG.md
27
CHANGELOG.md
@ -1,5 +1,32 @@
|
||||
# Changelog
|
||||
|
||||
# [1.9.0](https://github.com/axios/axios/compare/v1.8.4...v1.9.0) (2025-04-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **core:** fix the Axios constructor implementation to treat the config argument as optional; ([#6881](https://github.com/axios/axios/issues/6881)) ([6c5d4cd](https://github.com/axios/axios/commit/6c5d4cd69286868059c5e52d45085cb9a894a983))
|
||||
* **fetch:** fixed ERR_NETWORK mapping for Safari browsers; ([#6767](https://github.com/axios/axios/issues/6767)) ([dfe8411](https://github.com/axios/axios/commit/dfe8411c9a082c3d068bdd1f8d6e73054f387f45))
|
||||
* **headers:** allow iterable objects to be a data source for the set method; ([#6873](https://github.com/axios/axios/issues/6873)) ([1b1f9cc](https://github.com/axios/axios/commit/1b1f9ccdc15f1ea745160ec9a5223de9db4673bc))
|
||||
* **headers:** fix `getSetCookie` by using 'get' method for caseless access; ([#6874](https://github.com/axios/axios/issues/6874)) ([d4f7df4](https://github.com/axios/axios/commit/d4f7df4b304af8b373488fdf8e830793ff843eb9))
|
||||
* **headers:** fixed support for setting multiple header values from an iterated source; ([#6885](https://github.com/axios/axios/issues/6885)) ([f7a3b5e](https://github.com/axios/axios/commit/f7a3b5e0f7e5e127b97defa92a132fbf1b55cf15))
|
||||
* **http:** send minimal end multipart boundary ([#6661](https://github.com/axios/axios/issues/6661)) ([987d2e2](https://github.com/axios/axios/commit/987d2e2dd3b362757550f36eab875e60640b6ddc))
|
||||
* **types:** fix autocomplete for adapter config ([#6855](https://github.com/axios/axios/issues/6855)) ([e61a893](https://github.com/axios/axios/commit/e61a8934d8f94dd429a2f309b48c67307c700df0))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **AxiosHeaders:** add getSetCookie method to retrieve set-cookie headers values ([#5707](https://github.com/axios/axios/issues/5707)) ([80ea756](https://github.com/axios/axios/commit/80ea756e72bcf53110fa792f5d7ab76e8b11c996))
|
||||
|
||||
### Contributors to this release
|
||||
|
||||
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+200/-34 (#6890 #6889 #6888 #6885 #6881 #6767 #6874 #6873 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/4814473?v=4&s=18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+26/-1 ()")
|
||||
- <img src="https://avatars.githubusercontent.com/u/22686401?v=4&s=18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+21/-0 (#5707 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/2500247?v=4&s=18" alt="avatar" width="18"/> [George Cheng](https://github.com/Gerhut "+3/-3 (#5096 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/30260221?v=4&s=18" alt="avatar" width="18"/> [FatahChan](https://github.com/FatahChan "+2/-2 (#6855 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/49002?v=4&s=18" alt="avatar" width="18"/> [Ionuț G. Stan](https://github.com/igstan "+1/-1 (#6661 )")
|
||||
|
||||
## [1.8.4](https://github.com/axios/axios/compare/v1.8.3...v1.8.4) (2025-03-19)
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"main": "./dist/axios.js",
|
||||
"version": "1.8.4",
|
||||
"version": "1.9.0",
|
||||
"homepage": "https://axios-http.com",
|
||||
"authors": [
|
||||
"Matt Zabriskie"
|
||||
|
||||
48
dist/axios.js
vendored
48
dist/axios.js
vendored
@ -1,4 +1,4 @@
|
||||
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
/*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
@ -681,6 +681,8 @@
|
||||
|
||||
var toString = Object.prototype.toString;
|
||||
var getPrototypeOf = Object.getPrototypeOf;
|
||||
var iterator = Symbol.iterator,
|
||||
toStringTag = Symbol.toStringTag;
|
||||
var kindOf = function (cache) {
|
||||
return function (thing) {
|
||||
var str = toString.call(thing);
|
||||
@ -813,7 +815,7 @@
|
||||
return false;
|
||||
}
|
||||
var prototype = getPrototypeOf(val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1165,10 +1167,10 @@
|
||||
* @returns {void}
|
||||
*/
|
||||
var forEachEntry = function forEachEntry(obj, fn) {
|
||||
var generator = obj && obj[Symbol.iterator];
|
||||
var iterator = generator.call(obj);
|
||||
var generator = obj && obj[iterator];
|
||||
var _iterator = generator.call(obj);
|
||||
var result;
|
||||
while ((result = iterator.next()) && !result.done) {
|
||||
while ((result = _iterator.next()) && !result.done) {
|
||||
var pair = result.value;
|
||||
fn.call(obj, pair[0], pair[1]);
|
||||
}
|
||||
@ -1275,7 +1277,7 @@
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isSpecCompliantForm(thing) {
|
||||
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
||||
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
||||
}
|
||||
var toJSONObject = function toJSONObject(obj) {
|
||||
var stack = new Array(10);
|
||||
@ -1331,6 +1333,9 @@
|
||||
|
||||
// *********************
|
||||
|
||||
var isIterable = function isIterable(thing) {
|
||||
return thing != null && isFunction(thing[iterator]);
|
||||
};
|
||||
var utils$1 = {
|
||||
isArray: isArray,
|
||||
isArrayBuffer: isArrayBuffer,
|
||||
@ -1387,7 +1392,8 @@
|
||||
isAsyncFn: isAsyncFn,
|
||||
isThenable: isThenable,
|
||||
setImmediate: _setImmediate,
|
||||
asap: asap
|
||||
asap: asap,
|
||||
isIterable: isIterable
|
||||
};
|
||||
|
||||
/**
|
||||
@ -2227,21 +2233,26 @@
|
||||
setHeaders(header, valueOrRewrite);
|
||||
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
||||
setHeaders(parseHeaders(header), valueOrRewrite);
|
||||
} else if (utils$1.isHeaders(header)) {
|
||||
var _iterator = _createForOfIteratorHelper(header.entries()),
|
||||
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
||||
var obj = {},
|
||||
dest,
|
||||
key;
|
||||
var _iterator = _createForOfIteratorHelper(header),
|
||||
_step;
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var _step$value = _slicedToArray(_step.value, 2),
|
||||
key = _step$value[0],
|
||||
value = _step$value[1];
|
||||
setHeader(value, key, rewrite);
|
||||
var entry = _step.value;
|
||||
if (!utils$1.isArray(entry)) {
|
||||
throw TypeError('Object iterator must return a key-value pair');
|
||||
}
|
||||
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]] : entry[1];
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
setHeaders(obj, valueOrRewrite);
|
||||
} else {
|
||||
header != null && setHeader(valueOrRewrite, header, rewrite);
|
||||
}
|
||||
@ -2372,6 +2383,11 @@
|
||||
return header + ': ' + value;
|
||||
}).join('\n');
|
||||
}
|
||||
}, {
|
||||
key: "getSetCookie",
|
||||
value: function getSetCookie() {
|
||||
return this.get("set-cookie") || [];
|
||||
}
|
||||
}, {
|
||||
key: _Symbol$toStringTag,
|
||||
get: function get() {
|
||||
@ -3521,7 +3537,7 @@
|
||||
_context4.prev = 33;
|
||||
_context4.t2 = _context4["catch"](4);
|
||||
unsubscribe && unsubscribe();
|
||||
if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /fetch/i.test(_context4.t2.message))) {
|
||||
if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /Load failed|fetch/i.test(_context4.t2.message))) {
|
||||
_context4.next = 38;
|
||||
break;
|
||||
}
|
||||
@ -3658,7 +3674,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
var VERSION = "1.8.4";
|
||||
var VERSION = "1.9.0";
|
||||
|
||||
var validators$1 = {};
|
||||
|
||||
@ -3754,7 +3770,7 @@
|
||||
var Axios = /*#__PURE__*/function () {
|
||||
function Axios(instanceConfig) {
|
||||
_classCallCheck(this, Axios);
|
||||
this.defaults = instanceConfig;
|
||||
this.defaults = instanceConfig || {};
|
||||
this.interceptors = {
|
||||
request: new InterceptorManager$1(),
|
||||
response: new InterceptorManager$1()
|
||||
|
||||
2
dist/axios.js.map
vendored
2
dist/axios.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/axios.min.js
vendored
4
dist/axios.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/axios.min.js.map
vendored
2
dist/axios.min.js.map
vendored
File diff suppressed because one or more lines are too long
44
dist/browser/axios.cjs
vendored
44
dist/browser/axios.cjs
vendored
@ -1,4 +1,4 @@
|
||||
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
/*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
'use strict';
|
||||
|
||||
function bind(fn, thisArg) {
|
||||
@ -11,6 +11,7 @@ function bind(fn, thisArg) {
|
||||
|
||||
const {toString} = Object.prototype;
|
||||
const {getPrototypeOf} = Object;
|
||||
const {iterator, toStringTag} = Symbol;
|
||||
|
||||
const kindOf = (cache => thing => {
|
||||
const str = toString.call(thing);
|
||||
@ -137,7 +138,7 @@ const isPlainObject = (val) => {
|
||||
}
|
||||
|
||||
const prototype = getPrototypeOf(val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -488,13 +489,13 @@ const isTypedArray = (TypedArray => {
|
||||
* @returns {void}
|
||||
*/
|
||||
const forEachEntry = (obj, fn) => {
|
||||
const generator = obj && obj[Symbol.iterator];
|
||||
const generator = obj && obj[iterator];
|
||||
|
||||
const iterator = generator.call(obj);
|
||||
const _iterator = generator.call(obj);
|
||||
|
||||
let result;
|
||||
|
||||
while ((result = iterator.next()) && !result.done) {
|
||||
while ((result = _iterator.next()) && !result.done) {
|
||||
const pair = result.value;
|
||||
fn.call(obj, pair[0], pair[1]);
|
||||
}
|
||||
@ -615,7 +616,7 @@ const toFiniteNumber = (value, defaultValue) => {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isSpecCompliantForm(thing) {
|
||||
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
||||
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
||||
}
|
||||
|
||||
const toJSONObject = (obj) => {
|
||||
@ -684,6 +685,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
||||
|
||||
// *********************
|
||||
|
||||
|
||||
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
||||
|
||||
|
||||
var utils$1 = {
|
||||
isArray,
|
||||
isArrayBuffer,
|
||||
@ -739,7 +744,8 @@ var utils$1 = {
|
||||
isAsyncFn,
|
||||
isThenable,
|
||||
setImmediate: _setImmediate,
|
||||
asap
|
||||
asap,
|
||||
isIterable
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1724,10 +1730,18 @@ class AxiosHeaders {
|
||||
setHeaders(header, valueOrRewrite);
|
||||
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
||||
setHeaders(parseHeaders(header), valueOrRewrite);
|
||||
} else if (utils$1.isHeaders(header)) {
|
||||
for (const [key, value] of header.entries()) {
|
||||
setHeader(value, key, rewrite);
|
||||
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
||||
let obj = {}, dest, key;
|
||||
for (const entry of header) {
|
||||
if (!utils$1.isArray(entry)) {
|
||||
throw TypeError('Object iterator must return a key-value pair');
|
||||
}
|
||||
|
||||
obj[key = entry[0]] = (dest = obj[key]) ?
|
||||
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
|
||||
}
|
||||
|
||||
setHeaders(obj, valueOrRewrite);
|
||||
} else {
|
||||
header != null && setHeader(valueOrRewrite, header, rewrite);
|
||||
}
|
||||
@ -1869,6 +1883,10 @@ class AxiosHeaders {
|
||||
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
||||
}
|
||||
|
||||
getSetCookie() {
|
||||
return this.get("set-cookie") || [];
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return 'AxiosHeaders';
|
||||
}
|
||||
@ -2908,7 +2926,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
||||
} catch (err) {
|
||||
unsubscribe && unsubscribe();
|
||||
|
||||
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
||||
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
||||
throw Object.assign(
|
||||
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
||||
{
|
||||
@ -3068,7 +3086,7 @@ function dispatchRequest(config) {
|
||||
});
|
||||
}
|
||||
|
||||
const VERSION = "1.8.4";
|
||||
const VERSION = "1.9.0";
|
||||
|
||||
const validators$1 = {};
|
||||
|
||||
@ -3176,7 +3194,7 @@ const validators = validator.validators;
|
||||
*/
|
||||
class Axios {
|
||||
constructor(instanceConfig) {
|
||||
this.defaults = instanceConfig;
|
||||
this.defaults = instanceConfig || {};
|
||||
this.interceptors = {
|
||||
request: new InterceptorManager$1(),
|
||||
response: new InterceptorManager$1()
|
||||
|
||||
2
dist/browser/axios.cjs.map
vendored
2
dist/browser/axios.cjs.map
vendored
File diff suppressed because one or more lines are too long
44
dist/esm/axios.js
vendored
44
dist/esm/axios.js
vendored
@ -1,4 +1,4 @@
|
||||
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
/*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
function bind(fn, thisArg) {
|
||||
return function wrap() {
|
||||
return fn.apply(thisArg, arguments);
|
||||
@ -9,6 +9,7 @@ function bind(fn, thisArg) {
|
||||
|
||||
const {toString} = Object.prototype;
|
||||
const {getPrototypeOf} = Object;
|
||||
const {iterator, toStringTag} = Symbol;
|
||||
|
||||
const kindOf = (cache => thing => {
|
||||
const str = toString.call(thing);
|
||||
@ -135,7 +136,7 @@ const isPlainObject = (val) => {
|
||||
}
|
||||
|
||||
const prototype = getPrototypeOf(val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -486,13 +487,13 @@ const isTypedArray = (TypedArray => {
|
||||
* @returns {void}
|
||||
*/
|
||||
const forEachEntry = (obj, fn) => {
|
||||
const generator = obj && obj[Symbol.iterator];
|
||||
const generator = obj && obj[iterator];
|
||||
|
||||
const iterator = generator.call(obj);
|
||||
const _iterator = generator.call(obj);
|
||||
|
||||
let result;
|
||||
|
||||
while ((result = iterator.next()) && !result.done) {
|
||||
while ((result = _iterator.next()) && !result.done) {
|
||||
const pair = result.value;
|
||||
fn.call(obj, pair[0], pair[1]);
|
||||
}
|
||||
@ -613,7 +614,7 @@ const toFiniteNumber = (value, defaultValue) => {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isSpecCompliantForm(thing) {
|
||||
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
||||
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
||||
}
|
||||
|
||||
const toJSONObject = (obj) => {
|
||||
@ -682,6 +683,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
||||
|
||||
// *********************
|
||||
|
||||
|
||||
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
||||
|
||||
|
||||
const utils$1 = {
|
||||
isArray,
|
||||
isArrayBuffer,
|
||||
@ -737,7 +742,8 @@ const utils$1 = {
|
||||
isAsyncFn,
|
||||
isThenable,
|
||||
setImmediate: _setImmediate,
|
||||
asap
|
||||
asap,
|
||||
isIterable
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1722,10 +1728,18 @@ class AxiosHeaders$1 {
|
||||
setHeaders(header, valueOrRewrite);
|
||||
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
||||
setHeaders(parseHeaders(header), valueOrRewrite);
|
||||
} else if (utils$1.isHeaders(header)) {
|
||||
for (const [key, value] of header.entries()) {
|
||||
setHeader(value, key, rewrite);
|
||||
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
||||
let obj = {}, dest, key;
|
||||
for (const entry of header) {
|
||||
if (!utils$1.isArray(entry)) {
|
||||
throw TypeError('Object iterator must return a key-value pair');
|
||||
}
|
||||
|
||||
obj[key = entry[0]] = (dest = obj[key]) ?
|
||||
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
|
||||
}
|
||||
|
||||
setHeaders(obj, valueOrRewrite);
|
||||
} else {
|
||||
header != null && setHeader(valueOrRewrite, header, rewrite);
|
||||
}
|
||||
@ -1867,6 +1881,10 @@ class AxiosHeaders$1 {
|
||||
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
||||
}
|
||||
|
||||
getSetCookie() {
|
||||
return this.get("set-cookie") || [];
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return 'AxiosHeaders';
|
||||
}
|
||||
@ -2906,7 +2924,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||
} catch (err) {
|
||||
unsubscribe && unsubscribe();
|
||||
|
||||
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
||||
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
||||
throw Object.assign(
|
||||
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
|
||||
{
|
||||
@ -3066,7 +3084,7 @@ function dispatchRequest(config) {
|
||||
});
|
||||
}
|
||||
|
||||
const VERSION$1 = "1.8.4";
|
||||
const VERSION$1 = "1.9.0";
|
||||
|
||||
const validators$1 = {};
|
||||
|
||||
@ -3174,7 +3192,7 @@ const validators = validator.validators;
|
||||
*/
|
||||
class Axios$1 {
|
||||
constructor(instanceConfig) {
|
||||
this.defaults = instanceConfig;
|
||||
this.defaults = instanceConfig || {};
|
||||
this.interceptors = {
|
||||
request: new InterceptorManager$1(),
|
||||
response: new InterceptorManager$1()
|
||||
|
||||
2
dist/esm/axios.js.map
vendored
2
dist/esm/axios.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/esm/axios.min.js
vendored
4
dist/esm/axios.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/esm/axios.min.js.map
vendored
2
dist/esm/axios.min.js.map
vendored
File diff suppressed because one or more lines are too long
46
dist/node/axios.cjs
vendored
46
dist/node/axios.cjs
vendored
@ -1,4 +1,4 @@
|
||||
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
/*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
||||
'use strict';
|
||||
|
||||
const FormData$1 = require('form-data');
|
||||
@ -36,6 +36,7 @@ function bind(fn, thisArg) {
|
||||
|
||||
const {toString} = Object.prototype;
|
||||
const {getPrototypeOf} = Object;
|
||||
const {iterator, toStringTag} = Symbol;
|
||||
|
||||
const kindOf = (cache => thing => {
|
||||
const str = toString.call(thing);
|
||||
@ -162,7 +163,7 @@ const isPlainObject = (val) => {
|
||||
}
|
||||
|
||||
const prototype = getPrototypeOf(val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -513,13 +514,13 @@ const isTypedArray = (TypedArray => {
|
||||
* @returns {void}
|
||||
*/
|
||||
const forEachEntry = (obj, fn) => {
|
||||
const generator = obj && obj[Symbol.iterator];
|
||||
const generator = obj && obj[iterator];
|
||||
|
||||
const iterator = generator.call(obj);
|
||||
const _iterator = generator.call(obj);
|
||||
|
||||
let result;
|
||||
|
||||
while ((result = iterator.next()) && !result.done) {
|
||||
while ((result = _iterator.next()) && !result.done) {
|
||||
const pair = result.value;
|
||||
fn.call(obj, pair[0], pair[1]);
|
||||
}
|
||||
@ -640,7 +641,7 @@ const toFiniteNumber = (value, defaultValue) => {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function isSpecCompliantForm(thing) {
|
||||
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
||||
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
||||
}
|
||||
|
||||
const toJSONObject = (obj) => {
|
||||
@ -709,6 +710,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
||||
|
||||
// *********************
|
||||
|
||||
|
||||
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
||||
|
||||
|
||||
const utils$1 = {
|
||||
isArray,
|
||||
isArrayBuffer,
|
||||
@ -764,7 +769,8 @@ const utils$1 = {
|
||||
isAsyncFn,
|
||||
isThenable,
|
||||
setImmediate: _setImmediate,
|
||||
asap
|
||||
asap,
|
||||
isIterable
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1767,10 +1773,18 @@ class AxiosHeaders {
|
||||
setHeaders(header, valueOrRewrite);
|
||||
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
||||
setHeaders(parseHeaders(header), valueOrRewrite);
|
||||
} else if (utils$1.isHeaders(header)) {
|
||||
for (const [key, value] of header.entries()) {
|
||||
setHeader(value, key, rewrite);
|
||||
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
||||
let obj = {}, dest, key;
|
||||
for (const entry of header) {
|
||||
if (!utils$1.isArray(entry)) {
|
||||
throw TypeError('Object iterator must return a key-value pair');
|
||||
}
|
||||
|
||||
obj[key = entry[0]] = (dest = obj[key]) ?
|
||||
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
|
||||
}
|
||||
|
||||
setHeaders(obj, valueOrRewrite);
|
||||
} else {
|
||||
header != null && setHeader(valueOrRewrite, header, rewrite);
|
||||
}
|
||||
@ -1912,6 +1926,10 @@ class AxiosHeaders {
|
||||
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
||||
}
|
||||
|
||||
getSetCookie() {
|
||||
return this.get("set-cookie") || [];
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return 'AxiosHeaders';
|
||||
}
|
||||
@ -2084,7 +2102,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
||||
return requestedURL;
|
||||
}
|
||||
|
||||
const VERSION = "1.8.4";
|
||||
const VERSION = "1.9.0";
|
||||
|
||||
function parseProtocol(url) {
|
||||
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
||||
@ -2366,7 +2384,7 @@ const formDataToStream = (form, headersHandler, options) => {
|
||||
}
|
||||
|
||||
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
|
||||
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
|
||||
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
|
||||
let contentLength = footerBytes.byteLength;
|
||||
|
||||
const parts = Array.from(form.entries()).map(([name, value]) => {
|
||||
@ -3967,7 +3985,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||
} catch (err) {
|
||||
unsubscribe && unsubscribe();
|
||||
|
||||
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
||||
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
||||
throw Object.assign(
|
||||
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
||||
{
|
||||
@ -4233,7 +4251,7 @@ const validators = validator.validators;
|
||||
*/
|
||||
class Axios {
|
||||
constructor(instanceConfig) {
|
||||
this.defaults = instanceConfig;
|
||||
this.defaults = instanceConfig || {};
|
||||
this.interceptors = {
|
||||
request: new InterceptorManager$1(),
|
||||
response: new InterceptorManager$1()
|
||||
|
||||
2
dist/node/axios.cjs.map
vendored
2
dist/node/axios.cjs.map
vendored
File diff suppressed because one or more lines are too long
2
lib/env/data.js
vendored
2
lib/env/data.js
vendored
@ -1 +1 @@
|
||||
export const VERSION = "1.8.4";
|
||||
export const VERSION = "1.9.0";
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"version": "1.8.4",
|
||||
"version": "1.9.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "axios",
|
||||
"version": "1.8.4",
|
||||
"version": "1.9.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"version": "1.8.4",
|
||||
"version": "1.9.0",
|
||||
"description": "Promise based HTTP client for the browser and node.js",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
@ -167,10 +167,10 @@
|
||||
"Justin Beckwith (https://github.com/JustinBeckwith)",
|
||||
"Martti Laine (https://github.com/codeclown)",
|
||||
"Xianming Zhong (https://github.com/chinesedfan)",
|
||||
"Remco Haszing (https://github.com/remcohaszing)",
|
||||
"Rikki Gibson (https://github.com/RikkiGibson)",
|
||||
"Ben Carp (https://github.com/carpben)",
|
||||
"Yasu Flores (https://github.com/yasuf)"
|
||||
"Remco Haszing (https://github.com/remcohaszing)",
|
||||
"Yasu Flores (https://github.com/yasuf)",
|
||||
"Ben Carp (https://github.com/carpben)"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"release-it": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user