mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
chore(release): v1.7.8 (#6715)
Co-authored-by: DigitalBrainJS <12586868+DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
0a8d6e19da
commit
415ca94401
@@ -1,5 +1,43 @@
|
||||
# Changelog
|
||||
|
||||
## [1.7.8](https://github.com/axios/axios/compare/v1.7.7...v1.7.8) (2024-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow passing a callback as paramsSerializer to buildURL ([#6680](https://github.com/axios/axios/issues/6680)) ([eac4619](https://github.com/axios/axios/commit/eac4619fe2e0926e876cd260ee21e3690381dbb5))
|
||||
* **core:** fixed config merging bug ([#6668](https://github.com/axios/axios/issues/6668)) ([5d99fe4](https://github.com/axios/axios/commit/5d99fe4491202a6268c71e5dcc09192359d73cea))
|
||||
* fixed width form to not shrink after 'Send Request' button is clicked ([#6644](https://github.com/axios/axios/issues/6644)) ([7ccd5fd](https://github.com/axios/axios/commit/7ccd5fd42402102d38712c32707bf055be72ab54))
|
||||
* **http:** add support for File objects as payload in http adapter ([#6588](https://github.com/axios/axios/issues/6588)) ([#6605](https://github.com/axios/axios/issues/6605)) ([6841d8d](https://github.com/axios/axios/commit/6841d8d18ddc71cc1bd202ffcfddb3f95622eef3))
|
||||
* **http:** fixed proxy-from-env module import ([#5222](https://github.com/axios/axios/issues/5222)) ([12b3295](https://github.com/axios/axios/commit/12b32957f1258aee94ef859809ed39f8f88f9dfa))
|
||||
* **http:** use `globalThis.TextEncoder` when available ([#6634](https://github.com/axios/axios/issues/6634)) ([df956d1](https://github.com/axios/axios/commit/df956d18febc9100a563298dfdf0f102c3d15410))
|
||||
* ios11 breaks when build ([#6608](https://github.com/axios/axios/issues/6608)) ([7638952](https://github.com/axios/axios/commit/763895270f7b50c7c780c3c9807ae8635de952cd))
|
||||
* **types:** add missing types for mergeConfig function ([#6590](https://github.com/axios/axios/issues/6590)) ([00de614](https://github.com/axios/axios/commit/00de614cd07b7149af335e202aef0e076c254f49))
|
||||
* **types:** export CJS types from ESM ([#6218](https://github.com/axios/axios/issues/6218)) ([c71811b](https://github.com/axios/axios/commit/c71811b00f2fcff558e4382ba913bdac4ad7200e))
|
||||
* updated stream aborted error message to be more clear ([#6615](https://github.com/axios/axios/issues/6615)) ([cc3217a](https://github.com/axios/axios/commit/cc3217a612024d83a663722a56d7a98d8759c6d5))
|
||||
* use URL API instead of DOM to fix a potential vulnerability warning; ([#6714](https://github.com/axios/axios/issues/6714)) ([0a8d6e1](https://github.com/axios/axios/commit/0a8d6e19da5b9899a2abafaaa06a75ee548597db))
|
||||
|
||||
### Contributors to this release
|
||||
|
||||
- <img src="https://avatars.githubusercontent.com/u/779047?v=4&s=18" alt="avatar" width="18"/> [Remco Haszing](https://github.com/remcohaszing "+108/-596 (#6218 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/4814473?v=4&s=18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+281/-19 (#6640 #6619 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/140250471?v=4&s=18" alt="avatar" width="18"/> [Aayush Yadav](https://github.com/aayushyadav020 "+124/-111 (#6617 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+12/-65 (#6714 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/479715?v=4&s=18" alt="avatar" width="18"/> [Ell Bradshaw](https://github.com/cincodenada "+29/-0 (#6489 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/60218780?v=4&s=18" alt="avatar" width="18"/> [Amit Saini](https://github.com/amitsainii "+13/-3 (#5237 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/19817867?v=4&s=18" alt="avatar" width="18"/> [Tommaso Paulon](https://github.com/guuido "+14/-1 (#6680 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/63336443?v=4&s=18" alt="avatar" width="18"/> [Akki](https://github.com/Aakash-Rana "+5/-5 (#6668 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/20028934?v=4&s=18" alt="avatar" width="18"/> [Sampo Silvennoinen](https://github.com/stscoundrel "+3/-3 (#6633 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/1174718?v=4&s=18" alt="avatar" width="18"/> [Kasper Isager Dalsgarð](https://github.com/kasperisager "+2/-2 (#6634 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/3709715?v=4&s=18" alt="avatar" width="18"/> [Christian Clauss](https://github.com/cclauss "+4/-0 (#6683 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/1639119?v=4&s=18" alt="avatar" width="18"/> [Pavan Welihinda](https://github.com/pavan168 "+2/-2 (#5222 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/5742900?v=4&s=18" alt="avatar" width="18"/> [Taylor Flatt](https://github.com/taylorflatt "+2/-2 (#6615 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/79452224?v=4&s=18" alt="avatar" width="18"/> [Kenzo Wada](https://github.com/Kenzo-Wada "+2/-2 (#6608 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/50064240?v=4&s=18" alt="avatar" width="18"/> [Ngole Lawson](https://github.com/echelonnought "+3/-0 (#6644 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/1262198?v=4&s=18" alt="avatar" width="18"/> [Haven](https://github.com/Baoyx007 "+3/-0 (#6590 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/149003676?v=4&s=18" alt="avatar" width="18"/> [Shrivali Dutt](https://github.com/shrivalidutt "+1/-1 (#6637 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/1304290?v=4&s=18" alt="avatar" width="18"/> [Henco Appel](https://github.com/hencoappel "+1/-1 (#6605 )")
|
||||
|
||||
## [1.7.7](https://github.com/axios/axios/compare/v1.7.6...v1.7.7) (2024-08-31)
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"main": "./dist/axios.js",
|
||||
"version": "1.7.7",
|
||||
"version": "1.7.8",
|
||||
"homepage": "https://axios-http.com",
|
||||
"authors": [
|
||||
"Matt Zabriskie"
|
||||
|
||||
Vendored
+34
-63
@@ -1,4 +1,4 @@
|
||||
// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
// Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
@@ -1735,7 +1735,7 @@
|
||||
*
|
||||
* @param {string} url The base of the url (e.g., http://www.google.com)
|
||||
* @param {object} [params] The params to be appended
|
||||
* @param {?object} options
|
||||
* @param {?(object|Function)} options
|
||||
*
|
||||
* @returns {string} The formatted url
|
||||
*/
|
||||
@@ -1745,6 +1745,11 @@
|
||||
return url;
|
||||
}
|
||||
var _encode = options && options.encode || encode;
|
||||
if (utils$1.isFunction(options)) {
|
||||
options = {
|
||||
serialize: options
|
||||
};
|
||||
}
|
||||
var serializeFn = options && options.serialize;
|
||||
var serializedParams;
|
||||
if (serializeFn) {
|
||||
@@ -2642,60 +2647,14 @@
|
||||
};
|
||||
};
|
||||
|
||||
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
||||
// Standard browser envs have full support of the APIs needed to test
|
||||
// whether the request URL is of the same origin as current location.
|
||||
function standardBrowserEnv() {
|
||||
var msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
|
||||
var urlParsingNode = document.createElement('a');
|
||||
var originURL;
|
||||
|
||||
/**
|
||||
* Parse a URL to discover its components
|
||||
*
|
||||
* @param {String} url The URL to be parsed
|
||||
* @returns {Object}
|
||||
*/
|
||||
function resolveURL(url) {
|
||||
var href = url;
|
||||
if (msie) {
|
||||
// IE needs attribute set twice to normalize properties
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
href = urlParsingNode.href;
|
||||
}
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
|
||||
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
||||
return {
|
||||
href: urlParsingNode.href,
|
||||
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
||||
host: urlParsingNode.host,
|
||||
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
||||
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
||||
hostname: urlParsingNode.hostname,
|
||||
port: urlParsingNode.port,
|
||||
pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname
|
||||
};
|
||||
}
|
||||
originURL = resolveURL(window.location.href);
|
||||
|
||||
/**
|
||||
* Determine if a URL shares the same origin as the current location
|
||||
*
|
||||
* @param {String} requestURL The URL to test
|
||||
* @returns {boolean} True if URL shares the same origin, otherwise false
|
||||
*/
|
||||
return function isURLSameOrigin(requestURL) {
|
||||
var parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
||||
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
||||
var isURLSameOrigin = platform.hasStandardBrowserEnv ? function (origin, isMSIE) {
|
||||
return function (url) {
|
||||
url = new URL(url, platform.origin);
|
||||
return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
|
||||
};
|
||||
}() :
|
||||
// Non standard browser envs (web workers, react-native) lack needed support.
|
||||
function nonStandardBrowserEnv() {
|
||||
return function isURLSameOrigin() {
|
||||
return true;
|
||||
};
|
||||
}();
|
||||
}(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : function () {
|
||||
return true;
|
||||
};
|
||||
|
||||
var cookies = platform.hasStandardBrowserEnv ?
|
||||
// Standard browser envs support document.cookie
|
||||
@@ -2785,7 +2744,7 @@
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
config2 = config2 || {};
|
||||
var config = {};
|
||||
function getMergedValue(target, source, caseless) {
|
||||
function getMergedValue(target, source, prop, caseless) {
|
||||
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
||||
return utils$1.merge.call({
|
||||
caseless: caseless
|
||||
@@ -2799,11 +2758,11 @@
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function mergeDeepProperties(a, b, caseless) {
|
||||
function mergeDeepProperties(a, b, prop, caseless) {
|
||||
if (!utils$1.isUndefined(b)) {
|
||||
return getMergedValue(a, b, caseless);
|
||||
return getMergedValue(a, b, prop, caseless);
|
||||
} else if (!utils$1.isUndefined(a)) {
|
||||
return getMergedValue(undefined, a, caseless);
|
||||
return getMergedValue(undefined, a, prop, caseless);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2860,8 +2819,8 @@
|
||||
socketPath: defaultToConfig2,
|
||||
responseEncoding: defaultToConfig2,
|
||||
validateStatus: mergeDirectKeys,
|
||||
headers: function headers(a, b) {
|
||||
return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
|
||||
headers: function headers(a, b, prop) {
|
||||
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
||||
}
|
||||
};
|
||||
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
@@ -3717,7 +3676,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
var VERSION = "1.7.7";
|
||||
var VERSION = "1.7.8";
|
||||
|
||||
var validators$1 = {};
|
||||
|
||||
@@ -3756,6 +3715,13 @@
|
||||
return validator ? validator(value, opt, opts) : true;
|
||||
};
|
||||
};
|
||||
validators$1.spelling = function spelling(correctSpelling) {
|
||||
return function (value, opt) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("".concat(opt, " is likely a misspelling of ").concat(correctSpelling));
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Assert object's properties type
|
||||
@@ -3838,7 +3804,8 @@
|
||||
_context.prev = 6;
|
||||
_context.t0 = _context["catch"](0);
|
||||
if (_context.t0 instanceof Error) {
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
|
||||
dummy = {};
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
||||
|
||||
// slice off the Error: ... line
|
||||
stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
||||
@@ -3900,6 +3867,10 @@
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
validator.assertOptions(config, {
|
||||
baseUrl: validators.spelling('baseURL'),
|
||||
withXsrfToken: validators.spelling('withXSRFToken')
|
||||
}, true);
|
||||
|
||||
// Set config.method
|
||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+40
-71
@@ -1,4 +1,4 @@
|
||||
// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
// Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
'use strict';
|
||||
|
||||
function bind(fn, thisArg) {
|
||||
@@ -1152,7 +1152,7 @@ function encode(val) {
|
||||
*
|
||||
* @param {string} url The base of the url (e.g., http://www.google.com)
|
||||
* @param {object} [params] The params to be appended
|
||||
* @param {?object} options
|
||||
* @param {?(object|Function)} options
|
||||
*
|
||||
* @returns {string} The formatted url
|
||||
*/
|
||||
@@ -1164,6 +1164,12 @@ function buildURL(url, params, options) {
|
||||
|
||||
const _encode = options && options.encode || encode;
|
||||
|
||||
if (utils$1.isFunction(options)) {
|
||||
options = {
|
||||
serialize: options
|
||||
};
|
||||
}
|
||||
|
||||
const serializeFn = options && options.serialize;
|
||||
|
||||
let serializedParams;
|
||||
@@ -2152,68 +2158,18 @@ const progressEventDecorator = (total, throttled) => {
|
||||
|
||||
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
||||
|
||||
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
||||
var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
|
||||
url = new URL(url, platform.origin);
|
||||
|
||||
// Standard browser envs have full support of the APIs needed to test
|
||||
// whether the request URL is of the same origin as current location.
|
||||
(function standardBrowserEnv() {
|
||||
const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
|
||||
const urlParsingNode = document.createElement('a');
|
||||
let originURL;
|
||||
|
||||
/**
|
||||
* Parse a URL to discover its components
|
||||
*
|
||||
* @param {String} url The URL to be parsed
|
||||
* @returns {Object}
|
||||
*/
|
||||
function resolveURL(url) {
|
||||
let href = url;
|
||||
|
||||
if (msie) {
|
||||
// IE needs attribute set twice to normalize properties
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
href = urlParsingNode.href;
|
||||
}
|
||||
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
|
||||
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
||||
return {
|
||||
href: urlParsingNode.href,
|
||||
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
||||
host: urlParsingNode.host,
|
||||
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
||||
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
||||
hostname: urlParsingNode.hostname,
|
||||
port: urlParsingNode.port,
|
||||
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
||||
urlParsingNode.pathname :
|
||||
'/' + urlParsingNode.pathname
|
||||
};
|
||||
}
|
||||
|
||||
originURL = resolveURL(window.location.href);
|
||||
|
||||
/**
|
||||
* Determine if a URL shares the same origin as the current location
|
||||
*
|
||||
* @param {String} requestURL The URL to test
|
||||
* @returns {boolean} True if URL shares the same origin, otherwise false
|
||||
*/
|
||||
return function isURLSameOrigin(requestURL) {
|
||||
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
||||
return (parsed.protocol === originURL.protocol &&
|
||||
parsed.host === originURL.host);
|
||||
};
|
||||
})() :
|
||||
|
||||
// Non standard browser envs (web workers, react-native) lack needed support.
|
||||
(function nonStandardBrowserEnv() {
|
||||
return function isURLSameOrigin() {
|
||||
return true;
|
||||
};
|
||||
})();
|
||||
return (
|
||||
origin.protocol === url.protocol &&
|
||||
origin.host === url.host &&
|
||||
(isMSIE || origin.port === url.port)
|
||||
);
|
||||
})(
|
||||
new URL(platform.origin),
|
||||
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
||||
) : () => true;
|
||||
|
||||
var cookies = platform.hasStandardBrowserEnv ?
|
||||
|
||||
@@ -2315,7 +2271,7 @@ function mergeConfig(config1, config2) {
|
||||
config2 = config2 || {};
|
||||
const config = {};
|
||||
|
||||
function getMergedValue(target, source, caseless) {
|
||||
function getMergedValue(target, source, prop, caseless) {
|
||||
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
||||
return utils$1.merge.call({caseless}, target, source);
|
||||
} else if (utils$1.isPlainObject(source)) {
|
||||
@@ -2327,11 +2283,11 @@ function mergeConfig(config1, config2) {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function mergeDeepProperties(a, b, caseless) {
|
||||
function mergeDeepProperties(a, b, prop , caseless) {
|
||||
if (!utils$1.isUndefined(b)) {
|
||||
return getMergedValue(a, b, caseless);
|
||||
return getMergedValue(a, b, prop , caseless);
|
||||
} else if (!utils$1.isUndefined(a)) {
|
||||
return getMergedValue(undefined, a, caseless);
|
||||
return getMergedValue(undefined, a, prop , caseless);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2389,7 +2345,7 @@ function mergeConfig(config1, config2) {
|
||||
socketPath: defaultToConfig2,
|
||||
responseEncoding: defaultToConfig2,
|
||||
validateStatus: mergeDirectKeys,
|
||||
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
||||
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
||||
};
|
||||
|
||||
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
@@ -3133,7 +3089,7 @@ function dispatchRequest(config) {
|
||||
});
|
||||
}
|
||||
|
||||
const VERSION = "1.7.7";
|
||||
const VERSION = "1.7.8";
|
||||
|
||||
const validators$1 = {};
|
||||
|
||||
@@ -3184,6 +3140,14 @@ validators$1.transitional = function transitional(validator, version, message) {
|
||||
};
|
||||
};
|
||||
|
||||
validators$1.spelling = function spelling(correctSpelling) {
|
||||
return (value, opt) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Assert object's properties type
|
||||
*
|
||||
@@ -3253,9 +3217,9 @@ class Axios {
|
||||
return await this._request(configOrUrl, config);
|
||||
} catch (err) {
|
||||
if (err instanceof Error) {
|
||||
let dummy;
|
||||
let dummy = {};
|
||||
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
||||
|
||||
// slice off the Error: ... line
|
||||
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
||||
@@ -3310,6 +3274,11 @@ class Axios {
|
||||
}
|
||||
}
|
||||
|
||||
validator.assertOptions(config, {
|
||||
baseUrl: validators.spelling('baseURL'),
|
||||
withXsrfToken: validators.spelling('withXSRFToken')
|
||||
}, true);
|
||||
|
||||
// Set config.method
|
||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+40
-71
@@ -1,4 +1,4 @@
|
||||
// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
// Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
function bind(fn, thisArg) {
|
||||
return function wrap() {
|
||||
return fn.apply(thisArg, arguments);
|
||||
@@ -1150,7 +1150,7 @@ function encode(val) {
|
||||
*
|
||||
* @param {string} url The base of the url (e.g., http://www.google.com)
|
||||
* @param {object} [params] The params to be appended
|
||||
* @param {?object} options
|
||||
* @param {?(object|Function)} options
|
||||
*
|
||||
* @returns {string} The formatted url
|
||||
*/
|
||||
@@ -1162,6 +1162,12 @@ function buildURL(url, params, options) {
|
||||
|
||||
const _encode = options && options.encode || encode;
|
||||
|
||||
if (utils$1.isFunction(options)) {
|
||||
options = {
|
||||
serialize: options
|
||||
};
|
||||
}
|
||||
|
||||
const serializeFn = options && options.serialize;
|
||||
|
||||
let serializedParams;
|
||||
@@ -2150,68 +2156,18 @@ const progressEventDecorator = (total, throttled) => {
|
||||
|
||||
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
||||
|
||||
const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
||||
const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
|
||||
url = new URL(url, platform.origin);
|
||||
|
||||
// Standard browser envs have full support of the APIs needed to test
|
||||
// whether the request URL is of the same origin as current location.
|
||||
(function standardBrowserEnv() {
|
||||
const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
|
||||
const urlParsingNode = document.createElement('a');
|
||||
let originURL;
|
||||
|
||||
/**
|
||||
* Parse a URL to discover its components
|
||||
*
|
||||
* @param {String} url The URL to be parsed
|
||||
* @returns {Object}
|
||||
*/
|
||||
function resolveURL(url) {
|
||||
let href = url;
|
||||
|
||||
if (msie) {
|
||||
// IE needs attribute set twice to normalize properties
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
href = urlParsingNode.href;
|
||||
}
|
||||
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
|
||||
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
||||
return {
|
||||
href: urlParsingNode.href,
|
||||
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
||||
host: urlParsingNode.host,
|
||||
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
||||
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
||||
hostname: urlParsingNode.hostname,
|
||||
port: urlParsingNode.port,
|
||||
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
||||
urlParsingNode.pathname :
|
||||
'/' + urlParsingNode.pathname
|
||||
};
|
||||
}
|
||||
|
||||
originURL = resolveURL(window.location.href);
|
||||
|
||||
/**
|
||||
* Determine if a URL shares the same origin as the current location
|
||||
*
|
||||
* @param {String} requestURL The URL to test
|
||||
* @returns {boolean} True if URL shares the same origin, otherwise false
|
||||
*/
|
||||
return function isURLSameOrigin(requestURL) {
|
||||
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
||||
return (parsed.protocol === originURL.protocol &&
|
||||
parsed.host === originURL.host);
|
||||
};
|
||||
})() :
|
||||
|
||||
// Non standard browser envs (web workers, react-native) lack needed support.
|
||||
(function nonStandardBrowserEnv() {
|
||||
return function isURLSameOrigin() {
|
||||
return true;
|
||||
};
|
||||
})();
|
||||
return (
|
||||
origin.protocol === url.protocol &&
|
||||
origin.host === url.host &&
|
||||
(isMSIE || origin.port === url.port)
|
||||
);
|
||||
})(
|
||||
new URL(platform.origin),
|
||||
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
||||
) : () => true;
|
||||
|
||||
const cookies = platform.hasStandardBrowserEnv ?
|
||||
|
||||
@@ -2313,7 +2269,7 @@ function mergeConfig$1(config1, config2) {
|
||||
config2 = config2 || {};
|
||||
const config = {};
|
||||
|
||||
function getMergedValue(target, source, caseless) {
|
||||
function getMergedValue(target, source, prop, caseless) {
|
||||
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
||||
return utils$1.merge.call({caseless}, target, source);
|
||||
} else if (utils$1.isPlainObject(source)) {
|
||||
@@ -2325,11 +2281,11 @@ function mergeConfig$1(config1, config2) {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function mergeDeepProperties(a, b, caseless) {
|
||||
function mergeDeepProperties(a, b, prop , caseless) {
|
||||
if (!utils$1.isUndefined(b)) {
|
||||
return getMergedValue(a, b, caseless);
|
||||
return getMergedValue(a, b, prop , caseless);
|
||||
} else if (!utils$1.isUndefined(a)) {
|
||||
return getMergedValue(undefined, a, caseless);
|
||||
return getMergedValue(undefined, a, prop , caseless);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2387,7 +2343,7 @@ function mergeConfig$1(config1, config2) {
|
||||
socketPath: defaultToConfig2,
|
||||
responseEncoding: defaultToConfig2,
|
||||
validateStatus: mergeDirectKeys,
|
||||
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
||||
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
||||
};
|
||||
|
||||
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
@@ -3131,7 +3087,7 @@ function dispatchRequest(config) {
|
||||
});
|
||||
}
|
||||
|
||||
const VERSION$1 = "1.7.7";
|
||||
const VERSION$1 = "1.7.8";
|
||||
|
||||
const validators$1 = {};
|
||||
|
||||
@@ -3182,6 +3138,14 @@ validators$1.transitional = function transitional(validator, version, message) {
|
||||
};
|
||||
};
|
||||
|
||||
validators$1.spelling = function spelling(correctSpelling) {
|
||||
return (value, opt) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Assert object's properties type
|
||||
*
|
||||
@@ -3251,9 +3215,9 @@ class Axios$1 {
|
||||
return await this._request(configOrUrl, config);
|
||||
} catch (err) {
|
||||
if (err instanceof Error) {
|
||||
let dummy;
|
||||
let dummy = {};
|
||||
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
||||
|
||||
// slice off the Error: ... line
|
||||
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
||||
@@ -3308,6 +3272,11 @@ class Axios$1 {
|
||||
}
|
||||
}
|
||||
|
||||
validator.assertOptions(config, {
|
||||
baseUrl: validators.spelling('baseURL'),
|
||||
withXsrfToken: validators.spelling('withXSRFToken')
|
||||
}, true);
|
||||
|
||||
// Set config.method
|
||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+45
-75
@@ -1,4 +1,4 @@
|
||||
// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
// Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
'use strict';
|
||||
|
||||
const FormData$1 = require('form-data');
|
||||
@@ -16,6 +16,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
||||
|
||||
const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
|
||||
const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
|
||||
const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv);
|
||||
const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
|
||||
const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
|
||||
const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
|
||||
@@ -1171,7 +1172,7 @@ function encode(val) {
|
||||
*
|
||||
* @param {string} url The base of the url (e.g., http://www.google.com)
|
||||
* @param {object} [params] The params to be appended
|
||||
* @param {?object} options
|
||||
* @param {?(object|Function)} options
|
||||
*
|
||||
* @returns {string} The formatted url
|
||||
*/
|
||||
@@ -1183,6 +1184,12 @@ function buildURL(url, params, options) {
|
||||
|
||||
const _encode = options && options.encode || encode;
|
||||
|
||||
if (utils$1.isFunction(options)) {
|
||||
options = {
|
||||
serialize: options
|
||||
};
|
||||
}
|
||||
|
||||
const serializeFn = options && options.serialize;
|
||||
|
||||
let serializedParams;
|
||||
@@ -2071,7 +2078,7 @@ function buildFullPath(baseURL, requestedURL) {
|
||||
return requestedURL;
|
||||
}
|
||||
|
||||
const VERSION = "1.7.7";
|
||||
const VERSION = "1.7.8";
|
||||
|
||||
function parseProtocol(url) {
|
||||
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
||||
@@ -2283,7 +2290,7 @@ const readBlob$1 = readBlob;
|
||||
|
||||
const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
|
||||
|
||||
const textEncoder = new util.TextEncoder();
|
||||
const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default["default"].TextEncoder();
|
||||
|
||||
const CRLF = '\r\n';
|
||||
const CRLF_BYTES = textEncoder.encode(CRLF);
|
||||
@@ -2621,7 +2628,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
|
||||
function setProxy(options, configProxy, location) {
|
||||
let proxy = configProxy;
|
||||
if (!proxy && proxy !== false) {
|
||||
const proxyUrl = proxyFromEnv.getProxyForUrl(location);
|
||||
const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location);
|
||||
if (proxyUrl) {
|
||||
proxy = new URL(proxyUrl);
|
||||
}
|
||||
@@ -2852,7 +2859,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
} else if (utils$1.isBlob(data)) {
|
||||
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
||||
data.size && headers.setContentType(data.type || 'application/octet-stream');
|
||||
headers.setContentLength(data.size || 0);
|
||||
data = stream__default["default"].Readable.from(readBlob$1(data));
|
||||
@@ -3105,7 +3112,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
||||
}
|
||||
|
||||
const err = new AxiosError(
|
||||
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
||||
'stream has been aborted',
|
||||
AxiosError.ERR_BAD_RESPONSE,
|
||||
config,
|
||||
lastRequest
|
||||
@@ -3228,68 +3235,18 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
||||
});
|
||||
};
|
||||
|
||||
const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
||||
const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
|
||||
url = new URL(url, platform.origin);
|
||||
|
||||
// Standard browser envs have full support of the APIs needed to test
|
||||
// whether the request URL is of the same origin as current location.
|
||||
(function standardBrowserEnv() {
|
||||
const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
|
||||
const urlParsingNode = document.createElement('a');
|
||||
let originURL;
|
||||
|
||||
/**
|
||||
* Parse a URL to discover its components
|
||||
*
|
||||
* @param {String} url The URL to be parsed
|
||||
* @returns {Object}
|
||||
*/
|
||||
function resolveURL(url) {
|
||||
let href = url;
|
||||
|
||||
if (msie) {
|
||||
// IE needs attribute set twice to normalize properties
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
href = urlParsingNode.href;
|
||||
}
|
||||
|
||||
urlParsingNode.setAttribute('href', href);
|
||||
|
||||
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
||||
return {
|
||||
href: urlParsingNode.href,
|
||||
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
||||
host: urlParsingNode.host,
|
||||
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
||||
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
||||
hostname: urlParsingNode.hostname,
|
||||
port: urlParsingNode.port,
|
||||
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
||||
urlParsingNode.pathname :
|
||||
'/' + urlParsingNode.pathname
|
||||
};
|
||||
}
|
||||
|
||||
originURL = resolveURL(window.location.href);
|
||||
|
||||
/**
|
||||
* Determine if a URL shares the same origin as the current location
|
||||
*
|
||||
* @param {String} requestURL The URL to test
|
||||
* @returns {boolean} True if URL shares the same origin, otherwise false
|
||||
*/
|
||||
return function isURLSameOrigin(requestURL) {
|
||||
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
||||
return (parsed.protocol === originURL.protocol &&
|
||||
parsed.host === originURL.host);
|
||||
};
|
||||
})() :
|
||||
|
||||
// Non standard browser envs (web workers, react-native) lack needed support.
|
||||
(function nonStandardBrowserEnv() {
|
||||
return function isURLSameOrigin() {
|
||||
return true;
|
||||
};
|
||||
})();
|
||||
return (
|
||||
origin.protocol === url.protocol &&
|
||||
origin.host === url.host &&
|
||||
(isMSIE || origin.port === url.port)
|
||||
);
|
||||
})(
|
||||
new URL(platform.origin),
|
||||
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
||||
) : () => true;
|
||||
|
||||
const cookies = platform.hasStandardBrowserEnv ?
|
||||
|
||||
@@ -3346,7 +3303,7 @@ function mergeConfig(config1, config2) {
|
||||
config2 = config2 || {};
|
||||
const config = {};
|
||||
|
||||
function getMergedValue(target, source, caseless) {
|
||||
function getMergedValue(target, source, prop, caseless) {
|
||||
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
||||
return utils$1.merge.call({caseless}, target, source);
|
||||
} else if (utils$1.isPlainObject(source)) {
|
||||
@@ -3358,11 +3315,11 @@ function mergeConfig(config1, config2) {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
function mergeDeepProperties(a, b, caseless) {
|
||||
function mergeDeepProperties(a, b, prop , caseless) {
|
||||
if (!utils$1.isUndefined(b)) {
|
||||
return getMergedValue(a, b, caseless);
|
||||
return getMergedValue(a, b, prop , caseless);
|
||||
} else if (!utils$1.isUndefined(a)) {
|
||||
return getMergedValue(undefined, a, caseless);
|
||||
return getMergedValue(undefined, a, prop , caseless);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3420,7 +3377,7 @@ function mergeConfig(config1, config2) {
|
||||
socketPath: defaultToConfig2,
|
||||
responseEncoding: defaultToConfig2,
|
||||
validateStatus: mergeDirectKeys,
|
||||
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
||||
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
||||
};
|
||||
|
||||
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
@@ -4213,6 +4170,14 @@ validators$1.transitional = function transitional(validator, version, message) {
|
||||
};
|
||||
};
|
||||
|
||||
validators$1.spelling = function spelling(correctSpelling) {
|
||||
return (value, opt) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Assert object's properties type
|
||||
*
|
||||
@@ -4282,9 +4247,9 @@ class Axios {
|
||||
return await this._request(configOrUrl, config);
|
||||
} catch (err) {
|
||||
if (err instanceof Error) {
|
||||
let dummy;
|
||||
let dummy = {};
|
||||
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
|
||||
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
||||
|
||||
// slice off the Error: ... line
|
||||
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
||||
@@ -4339,6 +4304,11 @@ class Axios {
|
||||
}
|
||||
}
|
||||
|
||||
validator.assertOptions(config, {
|
||||
baseUrl: validators.spelling('baseURL'),
|
||||
withXsrfToken: validators.spelling('withXSRFToken')
|
||||
}, true);
|
||||
|
||||
// Set config.method
|
||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
export const VERSION = "1.7.7";
|
||||
export const VERSION = "1.7.8";
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"version": "1.7.7",
|
||||
"version": "1.7.8",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "axios",
|
||||
"version": "1.7.7",
|
||||
"version": "1.7.8",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"version": "1.7.7",
|
||||
"version": "1.7.8",
|
||||
"description": "Promise based HTTP client for the browser and node.js",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
@@ -163,12 +163,12 @@
|
||||
"Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)",
|
||||
"Jay (https://github.com/jasonsaayman)",
|
||||
"Emily Morehouse (https://github.com/emilyemorehouse)",
|
||||
"Rubén Norte (https://github.com/rubennorte)",
|
||||
"Justin Beckwith (https://github.com/JustinBeckwith)",
|
||||
"Rubén Norte (https://github.com/rubennorte)",
|
||||
"Martti Laine (https://github.com/codeclown)",
|
||||
"Xianming Zhong (https://github.com/chinesedfan)",
|
||||
"Rikki Gibson (https://github.com/RikkiGibson)",
|
||||
"Remco Haszing (https://github.com/remcohaszing)",
|
||||
"Rikki Gibson (https://github.com/RikkiGibson)",
|
||||
"Yasu Flores (https://github.com/yasuf)",
|
||||
"Ben Carp (https://github.com/carpben)"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user