axios 1.7.6 → 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 CHANGED
@@ -1,5 +1,56 @@
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&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Remco Haszing](https://github.com/remcohaszing "+108/-596 (#6218 )")
23
+ - <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 )")
24
+ - <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 )")
25
+ - <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 )")
26
+ - <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 )")
27
+ - <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 )")
28
+ - <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 )")
29
+ - <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 )")
30
+ - <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 )")
31
+ - <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 )")
32
+ - <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 )")
33
+ - <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 )")
34
+ - <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 )")
35
+ - <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 )")
36
+ - <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 )")
37
+ - <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 )")
38
+ - <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 )")
39
+ - <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 )")
40
+
41
+ ## [1.7.7](https://github.com/axios/axios/compare/v1.7.6...v1.7.7) (2024-08-31)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * **fetch:** fix stream handling in Safari by fallback to using a stream reader instead of an async iterator; ([#6584](https://github.com/axios/axios/issues/6584)) ([d198085](https://github.com/axios/axios/commit/d1980854fee1765cd02fa0787adf5d6e34dd9dcf))
47
+ * **http:** fixed support for IPv6 literal strings in url ([#5731](https://github.com/axios/axios/issues/5731)) ([364993f](https://github.com/axios/axios/commit/364993f0d8bc6e0e06f76b8a35d2d0a35cab054c))
48
+
49
+ ### Contributors to this release
50
+
51
+ - <img src="https://avatars.githubusercontent.com/u/10539109?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Rishi556](https://github.com/Rishi556 "+39/-1 (#5731 )")
52
+ - <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 "+27/-7 (#6584 )")
53
+
3
54
  ## [1.7.6](https://github.com/axios/axios/compare/v1.7.5...v1.7.6) (2024-08-30)
4
55
 
5
56
 
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.6 Copyright (c) 2024 Matt Zabriskie and contributors
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
- // 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;
2691
- };
2692
- }() :
2693
- // Non standard browser envs (web workers, react-native) lack needed support.
2694
- function nonStandardBrowserEnv() {
2695
- return function isURLSameOrigin() {
2696
- return true;
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);
2697
2654
  };
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) {
@@ -3167,7 +3126,7 @@
3167
3126
  }, streamChunk);
3168
3127
  });
3169
3128
  var readBytes = /*#__PURE__*/function () {
3170
- var _ref = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(iterable, chunkSize, encode) {
3129
+ var _ref = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(iterable, chunkSize) {
3171
3130
  var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk;
3172
3131
  return _regeneratorRuntime().wrap(function _callee$(_context2) {
3173
3132
  while (1) switch (_context2.prev = _context2.next) {
@@ -3175,82 +3134,111 @@
3175
3134
  _iteratorAbruptCompletion = false;
3176
3135
  _didIteratorError = false;
3177
3136
  _context2.prev = 2;
3178
- _iterator = _asyncIterator(iterable);
3137
+ _iterator = _asyncIterator(readStream(iterable));
3179
3138
  case 4:
3180
3139
  _context2.next = 6;
3181
3140
  return _awaitAsyncGenerator(_iterator.next());
3182
3141
  case 6:
3183
3142
  if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
3184
- _context2.next = 27;
3143
+ _context2.next = 12;
3185
3144
  break;
3186
3145
  }
3187
3146
  chunk = _step.value;
3188
- _context2.t0 = _asyncGeneratorDelegate;
3189
- _context2.t1 = _asyncIterator;
3190
- _context2.t2 = streamChunk;
3191
- if (!ArrayBuffer.isView(chunk)) {
3192
- _context2.next = 15;
3193
- break;
3194
- }
3195
- _context2.t3 = chunk;
3196
- _context2.next = 18;
3197
- break;
3198
- case 15:
3199
- _context2.next = 17;
3200
- return _awaitAsyncGenerator(encode(String(chunk)));
3201
- case 17:
3202
- _context2.t3 = _context2.sent;
3203
- case 18:
3204
- _context2.t4 = _context2.t3;
3205
- _context2.t5 = chunkSize;
3206
- _context2.t6 = (0, _context2.t2)(_context2.t4, _context2.t5);
3207
- _context2.t7 = (0, _context2.t1)(_context2.t6);
3208
- _context2.t8 = _awaitAsyncGenerator;
3209
- return _context2.delegateYield((0, _context2.t0)(_context2.t7, _context2.t8), "t9", 24);
3210
- case 24:
3147
+ return _context2.delegateYield(_asyncGeneratorDelegate(_asyncIterator(streamChunk(chunk, chunkSize))), "t0", 9);
3148
+ case 9:
3211
3149
  _iteratorAbruptCompletion = false;
3212
3150
  _context2.next = 4;
3213
3151
  break;
3214
- case 27:
3215
- _context2.next = 33;
3152
+ case 12:
3153
+ _context2.next = 18;
3216
3154
  break;
3217
- case 29:
3218
- _context2.prev = 29;
3219
- _context2.t10 = _context2["catch"](2);
3155
+ case 14:
3156
+ _context2.prev = 14;
3157
+ _context2.t1 = _context2["catch"](2);
3220
3158
  _didIteratorError = true;
3221
- _iteratorError = _context2.t10;
3222
- case 33:
3223
- _context2.prev = 33;
3224
- _context2.prev = 34;
3159
+ _iteratorError = _context2.t1;
3160
+ case 18:
3161
+ _context2.prev = 18;
3162
+ _context2.prev = 19;
3225
3163
  if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
3226
- _context2.next = 38;
3164
+ _context2.next = 23;
3227
3165
  break;
3228
3166
  }
3229
- _context2.next = 38;
3167
+ _context2.next = 23;
3230
3168
  return _awaitAsyncGenerator(_iterator["return"]());
3231
- case 38:
3232
- _context2.prev = 38;
3169
+ case 23:
3170
+ _context2.prev = 23;
3233
3171
  if (!_didIteratorError) {
3234
- _context2.next = 41;
3172
+ _context2.next = 26;
3235
3173
  break;
3236
3174
  }
3237
3175
  throw _iteratorError;
3238
- case 41:
3239
- return _context2.finish(38);
3240
- case 42:
3241
- return _context2.finish(33);
3242
- case 43:
3176
+ case 26:
3177
+ return _context2.finish(23);
3178
+ case 27:
3179
+ return _context2.finish(18);
3180
+ case 28:
3243
3181
  case "end":
3244
3182
  return _context2.stop();
3245
3183
  }
3246
- }, _callee, null, [[2, 29, 33, 43], [34,, 38, 42]]);
3184
+ }, _callee, null, [[2, 14, 18, 28], [19,, 23, 27]]);
3247
3185
  }));
3248
- return function readBytes(_x, _x2, _x3) {
3186
+ return function readBytes(_x, _x2) {
3249
3187
  return _ref.apply(this, arguments);
3250
3188
  };
3251
3189
  }();
3252
- var trackStream = function trackStream(stream, chunkSize, onProgress, onFinish, encode) {
3253
- var iterator = readBytes(stream, chunkSize, encode);
3190
+ var readStream = /*#__PURE__*/function () {
3191
+ var _ref2 = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(stream) {
3192
+ var reader, _yield$_awaitAsyncGen, done, value;
3193
+ return _regeneratorRuntime().wrap(function _callee2$(_context3) {
3194
+ while (1) switch (_context3.prev = _context3.next) {
3195
+ case 0:
3196
+ if (!stream[Symbol.asyncIterator]) {
3197
+ _context3.next = 3;
3198
+ break;
3199
+ }
3200
+ return _context3.delegateYield(_asyncGeneratorDelegate(_asyncIterator(stream)), "t0", 2);
3201
+ case 2:
3202
+ return _context3.abrupt("return");
3203
+ case 3:
3204
+ reader = stream.getReader();
3205
+ _context3.prev = 4;
3206
+ case 5:
3207
+ _context3.next = 7;
3208
+ return _awaitAsyncGenerator(reader.read());
3209
+ case 7:
3210
+ _yield$_awaitAsyncGen = _context3.sent;
3211
+ done = _yield$_awaitAsyncGen.done;
3212
+ value = _yield$_awaitAsyncGen.value;
3213
+ if (!done) {
3214
+ _context3.next = 12;
3215
+ break;
3216
+ }
3217
+ return _context3.abrupt("break", 16);
3218
+ case 12:
3219
+ _context3.next = 14;
3220
+ return value;
3221
+ case 14:
3222
+ _context3.next = 5;
3223
+ break;
3224
+ case 16:
3225
+ _context3.prev = 16;
3226
+ _context3.next = 19;
3227
+ return _awaitAsyncGenerator(reader.cancel());
3228
+ case 19:
3229
+ return _context3.finish(16);
3230
+ case 20:
3231
+ case "end":
3232
+ return _context3.stop();
3233
+ }
3234
+ }, _callee2, null, [[4,, 16, 20]]);
3235
+ }));
3236
+ return function readStream(_x3) {
3237
+ return _ref2.apply(this, arguments);
3238
+ };
3239
+ }();
3240
+ var trackStream = function trackStream(stream, chunkSize, onProgress, onFinish) {
3241
+ var iterator = readBytes(stream, chunkSize);
3254
3242
  var bytes = 0;
3255
3243
  var done;
3256
3244
  var _onFinish = function _onFinish(e) {
@@ -3261,25 +3249,25 @@
3261
3249
  };
3262
3250
  return new ReadableStream({
3263
3251
  pull: function pull(controller) {
3264
- return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
3252
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3265
3253
  var _yield$iterator$next, _done, value, len, loadedBytes;
3266
- return _regeneratorRuntime().wrap(function _callee2$(_context3) {
3267
- while (1) switch (_context3.prev = _context3.next) {
3254
+ return _regeneratorRuntime().wrap(function _callee3$(_context4) {
3255
+ while (1) switch (_context4.prev = _context4.next) {
3268
3256
  case 0:
3269
- _context3.prev = 0;
3270
- _context3.next = 3;
3257
+ _context4.prev = 0;
3258
+ _context4.next = 3;
3271
3259
  return iterator.next();
3272
3260
  case 3:
3273
- _yield$iterator$next = _context3.sent;
3261
+ _yield$iterator$next = _context4.sent;
3274
3262
  _done = _yield$iterator$next.done;
3275
3263
  value = _yield$iterator$next.value;
3276
3264
  if (!_done) {
3277
- _context3.next = 10;
3265
+ _context4.next = 10;
3278
3266
  break;
3279
3267
  }
3280
3268
  _onFinish();
3281
3269
  controller.close();
3282
- return _context3.abrupt("return");
3270
+ return _context4.abrupt("return");
3283
3271
  case 10:
3284
3272
  len = value.byteLength;
3285
3273
  if (onProgress) {
@@ -3287,18 +3275,18 @@
3287
3275
  onProgress(loadedBytes);
3288
3276
  }
3289
3277
  controller.enqueue(new Uint8Array(value));
3290
- _context3.next = 19;
3278
+ _context4.next = 19;
3291
3279
  break;
3292
3280
  case 15:
3293
- _context3.prev = 15;
3294
- _context3.t0 = _context3["catch"](0);
3295
- _onFinish(_context3.t0);
3296
- throw _context3.t0;
3281
+ _context4.prev = 15;
3282
+ _context4.t0 = _context4["catch"](0);
3283
+ _onFinish(_context4.t0);
3284
+ throw _context4.t0;
3297
3285
  case 19:
3298
3286
  case "end":
3299
- return _context3.stop();
3287
+ return _context4.stop();
3300
3288
  }
3301
- }, _callee2, null, [[0, 15]]);
3289
+ }, _callee3, null, [[0, 15]]);
3302
3290
  }))();
3303
3291
  },
3304
3292
  cancel: function cancel(reason) {
@@ -3493,7 +3481,7 @@
3493
3481
  }
3494
3482
  if (_request.body) {
3495
3483
  _progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1];
3496
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
3484
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
3497
3485
  }
3498
3486
  case 15:
3499
3487
  if (!utils$1.isString(withCredentials)) {
@@ -3526,7 +3514,7 @@
3526
3514
  response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, _onProgress, function () {
3527
3515
  _flush && _flush();
3528
3516
  unsubscribe && unsubscribe();
3529
- }, encodeText), options);
3517
+ }), options);
3530
3518
  }
3531
3519
  responseType = responseType || 'text';
3532
3520
  _context4.next = 26;
@@ -3688,7 +3676,7 @@
3688
3676
  });
3689
3677
  }
3690
3678
 
3691
- var VERSION = "1.7.6";
3679
+ var VERSION = "1.7.8";
3692
3680
 
3693
3681
  var validators$1 = {};
3694
3682
 
@@ -3727,6 +3715,13 @@
3727
3715
  return validator ? validator(value, opt, opts) : true;
3728
3716
  };
3729
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
+ };
3730
3725
 
3731
3726
  /**
3732
3727
  * Assert object's properties type
@@ -3809,7 +3804,8 @@
3809
3804
  _context.prev = 6;
3810
3805
  _context.t0 = _context["catch"](0);
3811
3806
  if (_context.t0 instanceof Error) {
3812
- Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
3807
+ dummy = {};
3808
+ Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
3813
3809
 
3814
3810
  // slice off the Error: ... line
3815
3811
  stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
@@ -3871,6 +3867,10 @@
3871
3867
  }, true);
3872
3868
  }
3873
3869
  }
3870
+ validator.assertOptions(config, {
3871
+ baseUrl: validators.spelling('baseURL'),
3872
+ withXsrfToken: validators.spelling('withXSRFToken')
3873
+ }, true);
3874
3874
 
3875
3875
  // Set config.method
3876
3876
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();