axios 1.7.7 → 1.7.9

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 CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.7.9](https://github.com/axios/axios/compare/v1.7.8...v1.7.9) (2024-12-04)
4
+
5
+
6
+ ### Reverts
7
+
8
+ * Revert "fix(types): export CJS types from ESM (#6218)" (#6729) ([c44d2f2](https://github.com/axios/axios/commit/c44d2f2316ad289b38997657248ba10de11deb6c)), closes [#6218](https://github.com/axios/axios/issues/6218) [#6729](https://github.com/axios/axios/issues/6729)
9
+
10
+ ### Contributors to this release
11
+
12
+ - <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+596/-108 (#6729 )")
13
+
14
+ ## [1.7.8](https://github.com/axios/axios/compare/v1.7.7...v1.7.8) (2024-11-25)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * allow passing a callback as paramsSerializer to buildURL ([#6680](https://github.com/axios/axios/issues/6680)) ([eac4619](https://github.com/axios/axios/commit/eac4619fe2e0926e876cd260ee21e3690381dbb5))
20
+ * **core:** fixed config merging bug ([#6668](https://github.com/axios/axios/issues/6668)) ([5d99fe4](https://github.com/axios/axios/commit/5d99fe4491202a6268c71e5dcc09192359d73cea))
21
+ * 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))
22
+ * **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))
23
+ * **http:** fixed proxy-from-env module import ([#5222](https://github.com/axios/axios/issues/5222)) ([12b3295](https://github.com/axios/axios/commit/12b32957f1258aee94ef859809ed39f8f88f9dfa))
24
+ * **http:** use `globalThis.TextEncoder` when available ([#6634](https://github.com/axios/axios/issues/6634)) ([df956d1](https://github.com/axios/axios/commit/df956d18febc9100a563298dfdf0f102c3d15410))
25
+ * ios11 breaks when build ([#6608](https://github.com/axios/axios/issues/6608)) ([7638952](https://github.com/axios/axios/commit/763895270f7b50c7c780c3c9807ae8635de952cd))
26
+ * **types:** add missing types for mergeConfig function ([#6590](https://github.com/axios/axios/issues/6590)) ([00de614](https://github.com/axios/axios/commit/00de614cd07b7149af335e202aef0e076c254f49))
27
+ * **types:** export CJS types from ESM ([#6218](https://github.com/axios/axios/issues/6218)) ([c71811b](https://github.com/axios/axios/commit/c71811b00f2fcff558e4382ba913bdac4ad7200e))
28
+ * 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))
29
+ * 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))
30
+
31
+ ### Contributors to this release
32
+
33
+ - <img src="https://avatars.githubusercontent.com/u/779047?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Remco Haszing](https://github.com/remcohaszing "+108/-596 (#6218 )")
34
+ - <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+281/-19 (#6640 #6619 )")
35
+ - <img src="https://avatars.githubusercontent.com/u/140250471?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Aayush Yadav](https://github.com/aayushyadav020 "+124/-111 (#6617 )")
36
+ - <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+12/-65 (#6714 )")
37
+ - <img src="https://avatars.githubusercontent.com/u/479715?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ell Bradshaw](https://github.com/cincodenada "+29/-0 (#6489 )")
38
+ - <img src="https://avatars.githubusercontent.com/u/60218780?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Amit Saini](https://github.com/amitsainii "+13/-3 (#5237 )")
39
+ - <img src="https://avatars.githubusercontent.com/u/19817867?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Tommaso Paulon](https://github.com/guuido "+14/-1 (#6680 )")
40
+ - <img src="https://avatars.githubusercontent.com/u/63336443?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Akki](https://github.com/Aakash-Rana "+5/-5 (#6668 )")
41
+ - <img src="https://avatars.githubusercontent.com/u/20028934?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Sampo Silvennoinen](https://github.com/stscoundrel "+3/-3 (#6633 )")
42
+ - <img src="https://avatars.githubusercontent.com/u/1174718?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Kasper Isager Dalsgarð](https://github.com/kasperisager "+2/-2 (#6634 )")
43
+ - <img src="https://avatars.githubusercontent.com/u/3709715?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Christian Clauss](https://github.com/cclauss "+4/-0 (#6683 )")
44
+ - <img src="https://avatars.githubusercontent.com/u/1639119?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Pavan Welihinda](https://github.com/pavan168 "+2/-2 (#5222 )")
45
+ - <img src="https://avatars.githubusercontent.com/u/5742900?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Taylor Flatt](https://github.com/taylorflatt "+2/-2 (#6615 )")
46
+ - <img src="https://avatars.githubusercontent.com/u/79452224?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Kenzo Wada](https://github.com/Kenzo-Wada "+2/-2 (#6608 )")
47
+ - <img src="https://avatars.githubusercontent.com/u/50064240?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ngole Lawson](https://github.com/echelonnought "+3/-0 (#6644 )")
48
+ - <img src="https://avatars.githubusercontent.com/u/1262198?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Haven](https://github.com/Baoyx007 "+3/-0 (#6590 )")
49
+ - <img src="https://avatars.githubusercontent.com/u/149003676?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shrivali Dutt](https://github.com/shrivalidutt "+1/-1 (#6637 )")
50
+ - <img src="https://avatars.githubusercontent.com/u/1304290?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Henco Appel](https://github.com/hencoappel "+1/-1 (#6605 )")
51
+
3
52
  ## [1.7.7](https://github.com/axios/axios/compare/v1.7.6...v1.7.7) (2024-08-31)
4
53
 
5
54
 
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://opencollective.com/buy-instagram-followers-buzzoid?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="62px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/buy-instagram-followers-buzzoid.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&#x27;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"> </p>
3
- </td><td align="center" width="33.333333333333336%"> <a href="https://stytch.com/?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;website-link&amp;utm_campaign&#x3D;axios-http" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="38px" media="(prefers-color-scheme: dark)" srcset="/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&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;website-link&amp;utm_campaign&#x3D;axios-http"><b>Website</b></a> | <a href="https://stytch.com/docs?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;docs-link&amp;utm_campaign&#x3D;axios-http"><b>Documentation</b></a> | <a href="https://github.com/stytchauth/stytch-node?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;node-sdk&amp;utm_campaign&#x3D;axios-http"><b>Node.js</b></a> </p>
4
- </td><td align="center" width="33.333333333333336%"> <a href="https://www.principal.com/about-us?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;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"> </p>
5
- </td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://www.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="52px" media="(prefers-color-scheme: dark)" srcset="/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&#x27;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&#x27;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&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Website</b></a> | <a href="https://docs.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Documentation</b></a> | <a href="https://www.descope.com/community?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Community</b></a> </p>
6
- </td><td align="center" width="33.333333333333336%"> <a href="https://route4me.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="51px" media="(prefers-color-scheme: dark)" srcset="/assets/sponsors/route4me_white.png"> <img width="200px" height="51px" src="https://axios-http.com/assets/sponsors/route4me.png" alt="Route4Me"/> </picture> </a> <p align="center" title="Best Route Planning And Route Optimization Software">Best Route Planning And Route Optimization Software</p> <p align="center"> <a href="https://route4me.com/platform/route-optimization-software"><b>Explore</b></a> | <a href="https://route4me.com/platform/marketplace/pricing"><b>Free Trial</b></a> | <a href="https://route4me.com/contact"><b>Contact</b></a> </p>
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&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;website-link&amp;utm_campaign&#x3D;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&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;website-link&amp;utm_campaign&#x3D;axios-http"><b>Website</b></a> | <a href="https://stytch.com/docs?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;docs-link&amp;utm_campaign&#x3D;axios-http"><b>Documentation</b></a> | <a href="https://github.com/stytchauth/stytch-node?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;node-sdk&amp;utm_campaign&#x3D;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&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;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&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>www.principal.com</b></a> </p>
4
+ </td><td align="center" width="33.333333333333336%"> <a href="https://www.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;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&#x27;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&#x27;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&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Website</b></a> | <a href="https://docs.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Documentation</b></a> | <a href="https://www.descope.com/community?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;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&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;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&#x27;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&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;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&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;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&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>www.famety.com</b></a> </p>
7
+ </td><td align="center" width="33.333333333333336%"> <a href="https://poprey.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;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&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;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
- ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) | ![IE](https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) |
101
- --- | --- | --- | --- | --- | --- |
104
+ ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png) | ![Safari](https://raw.githubusercontent.com/alrra/browser-logos/main/src/safari/safari_48x48.png) | ![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) |
105
+ --- | --- | --- | --- | --- |
102
106
  Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
103
107
 
104
108
  [![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](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.7 Copyright (c) 2024 Matt Zabriskie and contributors
1
+ // Axios v1.7.9 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
- // Standard browser envs have full support of the APIs needed to test
2647
- // whether the request URL is of the same origin as current location.
2648
- function standardBrowserEnv() {
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
- // Non standard browser envs (web workers, react-native) lack needed support.
2694
- function nonStandardBrowserEnv() {
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.7";
3679
+ var VERSION = "1.7.9";
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
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
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();