axios 1.7.7 → 1.7.8
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/CHANGELOG.md +38 -0
- package/README.md +20 -8
- package/dist/axios.js +34 -63
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +40 -71
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +40 -71
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +45 -75
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +38 -29
- package/index.d.ts +75 -561
- package/lib/adapters/http.js +4 -4
- package/lib/core/Axios.js +7 -2
- package/lib/core/mergeConfig.js +5 -5
- package/lib/env/data.js +1 -1
- package/lib/helpers/buildURL.js +7 -1
- package/lib/helpers/formDataToStream.js +2 -2
- package/lib/helpers/isURLSameOrigin.js +12 -65
- package/lib/helpers/validator.js +8 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,43 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.7.8](https://github.com/axios/axios/compare/v1.7.7...v1.7.8) (2024-11-25)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* allow passing a callback as paramsSerializer to buildURL ([#6680](https://github.com/axios/axios/issues/6680)) ([eac4619](https://github.com/axios/axios/commit/eac4619fe2e0926e876cd260ee21e3690381dbb5))
|
9
|
+
* **core:** fixed config merging bug ([#6668](https://github.com/axios/axios/issues/6668)) ([5d99fe4](https://github.com/axios/axios/commit/5d99fe4491202a6268c71e5dcc09192359d73cea))
|
10
|
+
* 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))
|
11
|
+
* **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))
|
12
|
+
* **http:** fixed proxy-from-env module import ([#5222](https://github.com/axios/axios/issues/5222)) ([12b3295](https://github.com/axios/axios/commit/12b32957f1258aee94ef859809ed39f8f88f9dfa))
|
13
|
+
* **http:** use `globalThis.TextEncoder` when available ([#6634](https://github.com/axios/axios/issues/6634)) ([df956d1](https://github.com/axios/axios/commit/df956d18febc9100a563298dfdf0f102c3d15410))
|
14
|
+
* ios11 breaks when build ([#6608](https://github.com/axios/axios/issues/6608)) ([7638952](https://github.com/axios/axios/commit/763895270f7b50c7c780c3c9807ae8635de952cd))
|
15
|
+
* **types:** add missing types for mergeConfig function ([#6590](https://github.com/axios/axios/issues/6590)) ([00de614](https://github.com/axios/axios/commit/00de614cd07b7149af335e202aef0e076c254f49))
|
16
|
+
* **types:** export CJS types from ESM ([#6218](https://github.com/axios/axios/issues/6218)) ([c71811b](https://github.com/axios/axios/commit/c71811b00f2fcff558e4382ba913bdac4ad7200e))
|
17
|
+
* 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))
|
18
|
+
* 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))
|
19
|
+
|
20
|
+
### Contributors to this release
|
21
|
+
|
22
|
+
- <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 )")
|
23
|
+
- <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 )")
|
24
|
+
- <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 )")
|
25
|
+
- <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 )")
|
26
|
+
- <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 )")
|
27
|
+
- <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 )")
|
28
|
+
- <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 )")
|
29
|
+
- <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 )")
|
30
|
+
- <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 )")
|
31
|
+
- <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 )")
|
32
|
+
- <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 )")
|
33
|
+
- <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 )")
|
34
|
+
- <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 )")
|
35
|
+
- <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 )")
|
36
|
+
- <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 )")
|
37
|
+
- <img src="https://avatars.githubusercontent.com/u/1262198?v=4&s=18" alt="avatar" width="18"/> [Haven](https://github.com/Baoyx007 "+3/-0 (#6590 )")
|
38
|
+
- <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 )")
|
39
|
+
- <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 )")
|
40
|
+
|
3
41
|
## [1.7.7](https://github.com/axios/axios/compare/v1.7.6...v1.7.7) (2024-08-31)
|
4
42
|
|
5
43
|
|
package/README.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
|
2
|
-
<h3 align="center"> 🥇 Gold sponsors <br> </h3> <table align="center" width="100%"><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://
|
3
|
-
</td><td align="center" width="33.333333333333336%"> <a href="https://
|
4
|
-
</td><td align="center" width="33.333333333333336%"> <a href="https://www.
|
5
|
-
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://
|
6
|
-
</td><td align="center" width="33.333333333333336%"> <a href="https://
|
2
|
+
<h3 align="center"> 🥇 Gold sponsors <br> </h3> <table align="center" width="100%"><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://stytch.com/?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=website-link&utm_campaign=axios-http" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="38px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/stytch_white.png"> <img width="200px" height="38px" src="https://axios-http.com/assets/sponsors/stytch.png" alt="Stytch"/> </picture> </a> <p align="center" title="API-first authentication, authorization, and fraud prevention">API-first authentication, authorization, and fraud prevention</p> <p align="center"> <a href="https://stytch.com/?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=website-link&utm_campaign=axios-http"><b>Website</b></a> | <a href="https://stytch.com/docs?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=docs-link&utm_campaign=axios-http"><b>Documentation</b></a> | <a href="https://github.com/stytchauth/stytch-node?utm_source=oss-sponsorship&utm_medium=paid_sponsorship&utm_content=node-sdk&utm_campaign=axios-http"><b>Node.js</b></a> </p>
|
3
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://www.principal.com/about-us?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="133px" height="43px" src="https://axios-http.com/assets/sponsors/principal.svg" alt="Principal Financial Group"/> </a> <p align="center" title="We’re bound by one common purpose: to give you the financial tools, resources and information you need to live your best life.">We’re bound by one common purpose: to give you the financial tools, resources and information you ne...</p> <p align="center"> <a href="https://www.principal.com/about-us?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>www.principal.com</b></a> </p>
|
4
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://www.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="52px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/descope_white.png"> <img width="200px" height="52px" src="https://axios-http.com/assets/sponsors/descope.png" alt="Descope"/> </picture> </a> <p align="center" title="Hi, we're Descope! We are building something in the authentication space for app developers and can’t wait to place it in your hands.">Hi, we're Descope! We are building something in the authentication space for app developers and...</p> <p align="center"> <a href="https://www.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship"><b>Website</b></a> | <a href="https://docs.descope.com/?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship"><b>Documentation</b></a> | <a href="https://www.descope.com/community?utm_source=axios&utm_medium=referral&utm_campaign=axios-oss-sponsorship"><b>Community</b></a> </p>
|
5
|
+
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="62px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/buzzoid-buy-instagram-followers.png" alt="Buzzoid - Buy Instagram Followers"/> </a> <p align="center" title="At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rated world's #1 IG service since 2012.">At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rate...</p> <p align="center"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>buzzoid.com</b></a> </p>
|
6
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://www.famety.com/buy-tiktok-likes?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/famety-buy-instagram-followers.png" alt="Famety - Buy Instagram Followers"/> </a> <p align="center" title="At Famety, you can grow your social media following quickly, safely, and easily with just a few clicks. Rated the world’s #1 social media service since 2013.">At Famety, you can grow your social media following quickly, safely, and easily with just a few clic...</p> <p align="center"> <a href="https://www.famety.com/buy-tiktok-likes?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>www.famety.com</b></a> </p>
|
7
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://poprey.com/?utm_source=axios&utm_medium=sponsorlist&utm_campaign=sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/instagram-likes.png" alt="Poprey - Buy Instagram Likes"/> </a> <p align="center" title="Buy Instagram Likes">Buy Instagram Likes</p> <p align="center"> <a href="https://poprey.com/?utm_source=axios&utm_medium=readme_sponsorlist&utm_campaign=sponsorship"><b>poprey.com</b></a> </p>
|
8
|
+
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>
|
9
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>
|
10
|
+
</td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>
|
7
11
|
</td></tr></table>
|
8
12
|
|
9
13
|
<!--<div>marker</div>-->
|
@@ -97,8 +101,8 @@
|
|
97
101
|
|
98
102
|
## Browser Support
|
99
103
|
|
100
|
-
 |  |  |  |  |
|
101
|
-
--- | --- | --- | --- | --- |
|
104
|
+
 |  |  |  |  |
|
105
|
+
--- | --- | --- | --- | --- |
|
102
106
|
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
|
103
107
|
|
104
108
|
[](https://saucelabs.com/u/axios)
|
@@ -153,6 +157,12 @@ const axios = require('axios');
|
|
153
157
|
console.log(axios.isCancel('something'));
|
154
158
|
```
|
155
159
|
|
160
|
+
For some bundlers and some ES6 linter's you may need to do the following:
|
161
|
+
|
162
|
+
```js
|
163
|
+
import { default as axios } from 'axios';
|
164
|
+
```
|
165
|
+
|
156
166
|
For cases where something went wrong when trying to import a module into a custom or legacy environment,
|
157
167
|
you can try importing the module package directly:
|
158
168
|
|
@@ -759,7 +769,7 @@ axios.interceptors.request.use(function (config) {
|
|
759
769
|
```
|
760
770
|
|
761
771
|
If you want to execute a particular interceptor based on a runtime check,
|
762
|
-
you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return
|
772
|
+
you can add a `runWhen` function to the options object. The request interceptor will not be executed **if and only if** the return
|
763
773
|
of `runWhen` is `false`. The function will be called with the config
|
764
774
|
object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an
|
765
775
|
asynchronous request interceptor that only needs to run at certain times.
|
@@ -774,6 +784,8 @@ axios.interceptors.request.use(function (config) {
|
|
774
784
|
}, null, { runWhen: onGetCall });
|
775
785
|
```
|
776
786
|
|
787
|
+
> **Note:** options parameter(having `synchronous` and `runWhen` properties) is only supported for request interceptors at the moment.
|
788
|
+
|
777
789
|
### Multiple Interceptors
|
778
790
|
|
779
791
|
Given you add multiple response interceptors
|
package/dist/axios.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.7.
|
1
|
+
// Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors
|
2
2
|
(function (global, factory) {
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
@@ -1735,7 +1735,7 @@
|
|
1735
1735
|
*
|
1736
1736
|
* @param {string} url The base of the url (e.g., http://www.google.com)
|
1737
1737
|
* @param {object} [params] The params to be appended
|
1738
|
-
* @param {?object} options
|
1738
|
+
* @param {?(object|Function)} options
|
1739
1739
|
*
|
1740
1740
|
* @returns {string} The formatted url
|
1741
1741
|
*/
|
@@ -1745,6 +1745,11 @@
|
|
1745
1745
|
return url;
|
1746
1746
|
}
|
1747
1747
|
var _encode = options && options.encode || encode;
|
1748
|
+
if (utils$1.isFunction(options)) {
|
1749
|
+
options = {
|
1750
|
+
serialize: options
|
1751
|
+
};
|
1752
|
+
}
|
1748
1753
|
var serializeFn = options && options.serialize;
|
1749
1754
|
var serializedParams;
|
1750
1755
|
if (serializeFn) {
|
@@ -2642,60 +2647,14 @@
|
|
2642
2647
|
};
|
2643
2648
|
};
|
2644
2649
|
|
2645
|
-
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
var msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
|
2650
|
-
var urlParsingNode = document.createElement('a');
|
2651
|
-
var originURL;
|
2652
|
-
|
2653
|
-
/**
|
2654
|
-
* Parse a URL to discover its components
|
2655
|
-
*
|
2656
|
-
* @param {String} url The URL to be parsed
|
2657
|
-
* @returns {Object}
|
2658
|
-
*/
|
2659
|
-
function resolveURL(url) {
|
2660
|
-
var href = url;
|
2661
|
-
if (msie) {
|
2662
|
-
// IE needs attribute set twice to normalize properties
|
2663
|
-
urlParsingNode.setAttribute('href', href);
|
2664
|
-
href = urlParsingNode.href;
|
2665
|
-
}
|
2666
|
-
urlParsingNode.setAttribute('href', href);
|
2667
|
-
|
2668
|
-
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
2669
|
-
return {
|
2670
|
-
href: urlParsingNode.href,
|
2671
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
2672
|
-
host: urlParsingNode.host,
|
2673
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
2674
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
2675
|
-
hostname: urlParsingNode.hostname,
|
2676
|
-
port: urlParsingNode.port,
|
2677
|
-
pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname
|
2678
|
-
};
|
2679
|
-
}
|
2680
|
-
originURL = resolveURL(window.location.href);
|
2681
|
-
|
2682
|
-
/**
|
2683
|
-
* Determine if a URL shares the same origin as the current location
|
2684
|
-
*
|
2685
|
-
* @param {String} requestURL The URL to test
|
2686
|
-
* @returns {boolean} True if URL shares the same origin, otherwise false
|
2687
|
-
*/
|
2688
|
-
return function isURLSameOrigin(requestURL) {
|
2689
|
-
var parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
2690
|
-
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
2650
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ? function (origin, isMSIE) {
|
2651
|
+
return function (url) {
|
2652
|
+
url = new URL(url, platform.origin);
|
2653
|
+
return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
|
2691
2654
|
};
|
2692
|
-
}() :
|
2693
|
-
|
2694
|
-
|
2695
|
-
return function isURLSameOrigin() {
|
2696
|
-
return true;
|
2697
|
-
};
|
2698
|
-
}();
|
2655
|
+
}(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : function () {
|
2656
|
+
return true;
|
2657
|
+
};
|
2699
2658
|
|
2700
2659
|
var cookies = platform.hasStandardBrowserEnv ?
|
2701
2660
|
// Standard browser envs support document.cookie
|
@@ -2785,7 +2744,7 @@
|
|
2785
2744
|
// eslint-disable-next-line no-param-reassign
|
2786
2745
|
config2 = config2 || {};
|
2787
2746
|
var config = {};
|
2788
|
-
function getMergedValue(target, source, caseless) {
|
2747
|
+
function getMergedValue(target, source, prop, caseless) {
|
2789
2748
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
2790
2749
|
return utils$1.merge.call({
|
2791
2750
|
caseless: caseless
|
@@ -2799,11 +2758,11 @@
|
|
2799
2758
|
}
|
2800
2759
|
|
2801
2760
|
// eslint-disable-next-line consistent-return
|
2802
|
-
function mergeDeepProperties(a, b, caseless) {
|
2761
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
2803
2762
|
if (!utils$1.isUndefined(b)) {
|
2804
|
-
return getMergedValue(a, b, caseless);
|
2763
|
+
return getMergedValue(a, b, prop, caseless);
|
2805
2764
|
} else if (!utils$1.isUndefined(a)) {
|
2806
|
-
return getMergedValue(undefined, a, caseless);
|
2765
|
+
return getMergedValue(undefined, a, prop, caseless);
|
2807
2766
|
}
|
2808
2767
|
}
|
2809
2768
|
|
@@ -2860,8 +2819,8 @@
|
|
2860
2819
|
socketPath: defaultToConfig2,
|
2861
2820
|
responseEncoding: defaultToConfig2,
|
2862
2821
|
validateStatus: mergeDirectKeys,
|
2863
|
-
headers: function headers(a, b) {
|
2864
|
-
return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
|
2822
|
+
headers: function headers(a, b, prop) {
|
2823
|
+
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
2865
2824
|
}
|
2866
2825
|
};
|
2867
2826
|
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
@@ -3717,7 +3676,7 @@
|
|
3717
3676
|
});
|
3718
3677
|
}
|
3719
3678
|
|
3720
|
-
var VERSION = "1.7.
|
3679
|
+
var VERSION = "1.7.8";
|
3721
3680
|
|
3722
3681
|
var validators$1 = {};
|
3723
3682
|
|
@@ -3756,6 +3715,13 @@
|
|
3756
3715
|
return validator ? validator(value, opt, opts) : true;
|
3757
3716
|
};
|
3758
3717
|
};
|
3718
|
+
validators$1.spelling = function spelling(correctSpelling) {
|
3719
|
+
return function (value, opt) {
|
3720
|
+
// eslint-disable-next-line no-console
|
3721
|
+
console.warn("".concat(opt, " is likely a misspelling of ").concat(correctSpelling));
|
3722
|
+
return true;
|
3723
|
+
};
|
3724
|
+
};
|
3759
3725
|
|
3760
3726
|
/**
|
3761
3727
|
* Assert object's properties type
|
@@ -3838,7 +3804,8 @@
|
|
3838
3804
|
_context.prev = 6;
|
3839
3805
|
_context.t0 = _context["catch"](0);
|
3840
3806
|
if (_context.t0 instanceof Error) {
|
3841
|
-
|
3807
|
+
dummy = {};
|
3808
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
3842
3809
|
|
3843
3810
|
// slice off the Error: ... line
|
3844
3811
|
stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
@@ -3900,6 +3867,10 @@
|
|
3900
3867
|
}, true);
|
3901
3868
|
}
|
3902
3869
|
}
|
3870
|
+
validator.assertOptions(config, {
|
3871
|
+
baseUrl: validators.spelling('baseURL'),
|
3872
|
+
withXsrfToken: validators.spelling('withXSRFToken')
|
3873
|
+
}, true);
|
3903
3874
|
|
3904
3875
|
// Set config.method
|
3905
3876
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|