axios 1.7.8 → 1.8.0

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,66 @@
1
1
  # Changelog
2
2
 
3
+ # [1.8.0](https://github.com/axios/axios/compare/v1.7.9...v1.8.0) (2025-02-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **examples:** application crashed when navigating examples in browser ([#5938](https://github.com/axios/axios/issues/5938)) ([1260ded](https://github.com/axios/axios/commit/1260ded634ec101dd5ed05d3b70f8e8f899dba6c))
9
+ * missing word in SUPPORT_QUESTION.yml ([#6757](https://github.com/axios/axios/issues/6757)) ([1f890b1](https://github.com/axios/axios/commit/1f890b13f2c25a016f3c84ae78efb769f244133e))
10
+ * **utils:** replace getRandomValues with crypto module ([#6788](https://github.com/axios/axios/issues/6788)) ([23a25af](https://github.com/axios/axios/commit/23a25af0688d1db2c396deb09229d2271cc24f6c))
11
+
12
+
13
+ ### Features
14
+
15
+ * Add config for ignoring absolute URLs ([#5902](https://github.com/axios/axios/issues/5902)) ([#6192](https://github.com/axios/axios/issues/6192)) ([32c7bcc](https://github.com/axios/axios/commit/32c7bcc0f233285ba27dec73a4b1e81fb7a219b3))
16
+
17
+
18
+ ### Reverts
19
+
20
+ * Revert "chore: expose fromDataToStream to be consumable (#6731)" (#6732) ([1317261](https://github.com/axios/axios/commit/1317261125e9c419fe9f126867f64d28f9c1efda)), closes [#6731](https://github.com/axios/axios/issues/6731) [#6732](https://github.com/axios/axios/issues/6732)
21
+
22
+
23
+ ### BREAKING CHANGES
24
+
25
+ * code relying on the above will now combine the URLs instead of prefer request URL
26
+
27
+ * feat: add config option for allowing absolute URLs
28
+
29
+ * fix: add default value for allowAbsoluteUrls in buildFullPath
30
+
31
+ * fix: typo in flow control when setting allowAbsoluteUrls
32
+
33
+ ### Contributors to this release
34
+
35
+ - <img src="https://avatars.githubusercontent.com/u/7661715?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Toscano](https://github.com/GethosTheWalrus "+42/-8 (#6192 )")
36
+ - <img src="https://avatars.githubusercontent.com/u/22686401?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+26/-3 (#6788 #6777 )")
37
+ - <img src="https://avatars.githubusercontent.com/u/72578270?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Naron](https://github.com/naronchen "+27/-0 (#5901 )")
38
+ - <img src="https://avatars.githubusercontent.com/u/47430686?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [shravan || श्रvan](https://github.com/shravan20 "+7/-3 (#6116 )")
39
+ - <img src="https://avatars.githubusercontent.com/u/145078271?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Justin Dhillon](https://github.com/justindhillon "+0/-7 (#6312 )")
40
+ - <img src="https://avatars.githubusercontent.com/u/30925732?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [yionr](https://github.com/yionr "+5/-1 (#6129 )")
41
+ - <img src="https://avatars.githubusercontent.com/u/534166?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shin&#x27;ya Ueoka](https://github.com/ueokande "+3/-3 (#5935 )")
42
+ - <img src="https://avatars.githubusercontent.com/u/33569?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dan Dascalescu](https://github.com/dandv "+3/-3 (#5908 #6757 )")
43
+ - <img src="https://avatars.githubusercontent.com/u/16476523?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Nitin Ramnani](https://github.com/NitinRamnani "+2/-2 (#5938 )")
44
+ - <img src="https://avatars.githubusercontent.com/u/152275799?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shay Molcho](https://github.com/shaymolcho "+2/-2 (#6770 )")
45
+ - <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+0/-3 (#6732 )")
46
+ - fancy45daddy
47
+ - <img src="https://avatars.githubusercontent.com/u/127725897?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Habip Akyol](https://github.com/habipakyol "+1/-1 (#6030 )")
48
+ - <img src="https://avatars.githubusercontent.com/u/54869395?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Bailey Lissington](https://github.com/llamington "+1/-1 (#6771 )")
49
+ - <img src="https://avatars.githubusercontent.com/u/14969290?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Bernardo da Eira Duarte](https://github.com/bernardoduarte "+1/-1 (#6480 )")
50
+ - <img src="https://avatars.githubusercontent.com/u/117800149?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shivam Batham](https://github.com/Shivam-Batham "+1/-1 (#5949 )")
51
+ - <img src="https://avatars.githubusercontent.com/u/67861627?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Lipin Kariappa](https://github.com/lipinnnnn "+1/-1 (#5936 )")
52
+
53
+ ## [1.7.9](https://github.com/axios/axios/compare/v1.7.8...v1.7.9) (2024-12-04)
54
+
55
+
56
+ ### Reverts
57
+
58
+ * 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)
59
+
60
+ ### Contributors to this release
61
+
62
+ - <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 )")
63
+
3
64
  ## [1.7.8](https://github.com/axios/axios/compare/v1.7.7...v1.7.8) (2024-11-25)
4
65
 
5
66
 
package/README.md CHANGED
@@ -3,9 +3,12 @@
3
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
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
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>
6
+ </td><td align="center" width="33.333333333333336%"> <a href="https://www.famety.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/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/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>www.famety.com</b></a> </p>
7
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>
8
+ </td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://musicza.co.za/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="124px" height="52px" src="https://axios-http.com/assets/sponsors/opencollective/musicza.png" alt="Tubidy"/> </a> <p align="center" title="Tubidy: Free Music and Video Downloads | MP3, MP4">Tubidy: Free Music and Video Downloads | MP3, MP4</p> <p align="center"> <a href="https://musicza.co.za/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>musicza.co.za</b></a> </p>
9
+ </td><td align="center" width="33.333333333333336%"> <a href="https://www.linkedin.com/pulse/7-best-sites-buy-instagram-followers-2024-100-non-drop-arvinder-singh-u6goc/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="63px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/bestsitesbuyinstagramfollowers.png" alt="Buy Instagram Followers"/> </a> <p align="center" title="Ookfy is the best place to buy Instagram followers, likes &amp; views. You can buy Real &amp; Non-Drop Instagram followers from Ookfy.">Ookfy is the best place to buy Instagram followers, likes &amp; views. You can buy Real &amp; Non-Dr...</p> <p align="center"> <a href="https://www.linkedin.com/pulse/7-best-sites-buy-instagram-followers-2024-100-non-drop-arvinder-singh-u6goc/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>www.linkedin.com</b></a> </p>
10
+ </td><td align="center" width="33.333333333333336%"> <a href="https://ssmarket.net/buy-youtube-subscribers?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/youtube-subscribers-ssmarket.png" alt="Buy Youtube Subscribers"/> </a> <p align="center" title="SS Market offers professional social media services that rapidly increase your YouTube subscriber count, elevating your channel to a powerful position.">SS Market offers professional social media services that rapidly increase your YouTube subscriber co...</p> <p align="center"> <a href="https://ssmarket.net/buy-youtube-subscribers?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>ssmarket.net</b></a> </p>
11
+ </td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://tokmax.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/tokmax.webp" alt="Tokmax"/> </a> <p align="center" title="At Tokmax, we are dedicated to being the leading platform for enhancing TikTok engagement. Whether you&#x27;re an emerging creator or an established influe">At Tokmax, we are dedicated to being the leading platform for enhancing TikTok engagement. Whether y...</p> <p align="center"> <a href="https://tokmax.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>tokmax.com</b></a> </p>
9
12
  </td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>
10
13
  </td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>
11
14
  </td></tr></table>
@@ -157,7 +160,7 @@ const axios = require('axios');
157
160
  console.log(axios.isCancel('something'));
158
161
  ```
159
162
 
160
- For some bundlers and some ES6 linter's you may need to do the following:
163
+ For some bundlers and some ES6 linters you may need to do the following:
161
164
 
162
165
  ```js
163
166
  import { default as axios } from 'axios';
@@ -372,11 +375,16 @@ These are the available config options for making requests. Only the `url` is re
372
375
  // `method` is the request method to be used when making the request
373
376
  method: 'get', // default
374
377
 
375
- // `baseURL` will be prepended to `url` unless `url` is absolute.
378
+ // `baseURL` will be prepended to `url` unless `url` is absolute and option `allowAbsoluteUrls` is set to true.
376
379
  // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs
377
380
  // to methods of that instance.
378
381
  baseURL: 'https://some-domain.com/api/',
379
382
 
383
+ // `allowAbsoluteUrls` determines whether or not absolute URLs will override a configured `baseUrl`.
384
+ // When set to true (default), absolute values for `url` will override `baseUrl`.
385
+ // When set to false, absolute values for `url` will always be prepended by `baseUrl`.
386
+ allowAbsoluteUrls: true,
387
+
380
388
  // `transformRequest` allows changes to the request data before it is sent to the server
381
389
  // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE'
382
390
  // The last function in the array must return a string or an instance of Buffer, ArrayBuffer,
@@ -408,13 +416,13 @@ These are the available config options for making requests. Only the `url` is re
408
416
  // `paramsSerializer` is an optional config that allows you to customize serializing `params`.
409
417
  paramsSerializer: {
410
418
 
411
- //Custom encoder function which sends key/value pairs in an iterative fashion.
419
+ // Custom encoder function which sends key/value pairs in an iterative fashion.
412
420
  encode?: (param: string): string => { /* Do custom operations here and return transformed string */ },
413
421
 
414
422
  // Custom serializer function for the entire parameter. Allows user to mimic pre 1.x behaviour.
415
423
  serialize?: (params: Record<string, any>, options?: ParamsSerializerOptions ),
416
424
 
417
- //Configuration for formatting array indexes in the params.
425
+ // Configuration for formatting array indexes in the params.
418
426
  indexes: false // Three available options: (1) indexes: null (leads to no brackets), (2) (default) indexes: false (leads to empty brackets), (3) indexes: true (leads to brackets with indexes).
419
427
  },
420
428
 
@@ -448,7 +456,7 @@ These are the available config options for making requests. Only the `url` is re
448
456
  },
449
457
  // Also, you can set the name of the built-in adapter, or provide an array with their names
450
458
  // to choose the first available in the environment
451
- adapter: 'xhr' // 'fetch' | 'http' | ['xhr', 'http', 'fetch']
459
+ adapter: 'xhr', // 'fetch' | 'http' | ['xhr', 'http', 'fetch']
452
460
 
453
461
  // `auth` indicates that HTTP Basic auth should be used, and supplies credentials.
454
462
  // This will set an `Authorization` header, overwriting any existing
@@ -528,7 +536,11 @@ These are the available config options for making requests. Only the `url` is re
528
536
  // If both are specified, `socketPath` is used.
529
537
  socketPath: null, // default
530
538
 
531
- // `transport` determines the transport method that will be used to make the request. If defined, it will be used. Otherwise, if `maxRedirects` is 0, the default `http` or `https` library will be used, depending on the protocol specified in `protocol`. Otherwise, the `httpFollow` or `httpsFollow` library will be used, again depending on the protocol, which can handle redirects.
539
+ // `transport` determines the transport method that will be used to make the request.
540
+ // If defined, it will be used. Otherwise, if `maxRedirects` is 0,
541
+ // the default `http` or `https` library will be used, depending on the protocol specified in `protocol`.
542
+ // Otherwise, the `httpFollow` or `httpsFollow` library will be used, again depending on the protocol,
543
+ // which can handle redirects.
532
544
  transport: undefined, // default
533
545
 
534
546
  // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http
@@ -690,7 +702,7 @@ instance.defaults.headers.common['Authorization'] = AUTH_TOKEN;
690
702
 
691
703
  ### Config order of precedence
692
704
 
693
- Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults/index.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example.
705
+ Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults/index.js](https://github.com/axios/axios/blob/main/lib/defaults/index.js#L49), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example.
694
706
 
695
707
  ```js
696
708
  // Create an instance using the config defaults provided by the library
@@ -712,8 +724,11 @@ instance.get('/longRequest', {
712
724
  You can intercept requests or responses before they are handled by `then` or `catch`.
713
725
 
714
726
  ```js
727
+
728
+ const instance = axios.create();
729
+
715
730
  // Add a request interceptor
716
- axios.interceptors.request.use(function (config) {
731
+ instance.interceptors.request.use(function (config) {
717
732
  // Do something before request is sent
718
733
  return config;
719
734
  }, function (error) {
@@ -722,7 +737,7 @@ axios.interceptors.request.use(function (config) {
722
737
  });
723
738
 
724
739
  // Add a response interceptor
725
- axios.interceptors.response.use(function (response) {
740
+ instance.interceptors.response.use(function (response) {
726
741
  // Any status code that lie within the range of 2xx cause this function to trigger
727
742
  // Do something with response data
728
743
  return response;
@@ -736,7 +751,8 @@ axios.interceptors.response.use(function (response) {
736
751
  If you need to remove an interceptor later you can.
737
752
 
738
753
  ```js
739
- const myInterceptor = axios.interceptors.request.use(function () {/*...*/});
754
+ const instance = axios.create();
755
+ const myInterceptor = instance.interceptors.request.use(function () {/*...*/});
740
756
  axios.interceptors.request.eject(myInterceptor);
741
757
  ```
742
758
 
@@ -815,7 +831,7 @@ The general structure of axios errors is as follows:
815
831
  | code | Represents an axios identified error. The table below lists out specific definitions for internal axios error. |
816
832
  | status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings.
817
833
 
818
- Below is a list of potential axios identified error
834
+ Below is a list of potential axios identified error:
819
835
  | Code | Definition |
820
836
  | -------- | ---------- |
821
837
  | ERR_BAD_OPTION_VALUE | Invalid or unsupported value provided in axios configuration. |
@@ -1126,7 +1142,7 @@ to a `FormData` object by following custom rules.
1126
1142
  - `metaTokens: boolean = true` - add the special ending (e.g `user{}: '{"name": "John"}'`) in the FormData key.
1127
1143
  The back-end body-parser could potentially use this meta-information to automatically parse the value as JSON.
1128
1144
 
1129
- - `indexes: null|false|true = false` - controls how indexes will be added to unwrapped keys of `flat` array-like objects
1145
+ - `indexes: null|false|true = false` - controls how indexes will be added to unwrapped keys of `flat` array-like objects.
1130
1146
 
1131
1147
  - `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`)
1132
1148
  - `false`(default) - add empty brackets (`arr[]: 1`, `arr[]: 2`, `arr[]: 3`)
package/dist/axios.js CHANGED
@@ -1,9 +1,13 @@
1
- // Axios v1.7.8 Copyright (c) 2024 Matt Zabriskie and contributors
1
+ /*! Axios v1.8.0 Copyright (c) 2025 Matt Zabriskie and contributors */
2
2
  (function (global, factory) {
3
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
- typeof define === 'function' && define.amd ? define(factory) :
5
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory());
6
- })(this, (function () { 'use strict';
3
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('crypto')) :
4
+ typeof define === 'function' && define.amd ? define(['crypto'], factory) :
5
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory(global.crypto));
6
+ })(this, (function (crypto) { 'use strict';
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
7
11
 
8
12
  function _AsyncGenerator(e) {
9
13
  var r, t;
@@ -1278,8 +1282,10 @@
1278
1282
  var alphabet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ALPHABET.ALPHA_DIGIT;
1279
1283
  var str = '';
1280
1284
  var length = alphabet.length;
1281
- while (size--) {
1282
- str += alphabet[Math.random() * length | 0];
1285
+ var randomValues = new Uint32Array(size);
1286
+ crypto__default["default"].randomFillSync(randomValues);
1287
+ for (var i = 0; i < size; i++) {
1288
+ str += alphabet[randomValues[i] % length];
1283
1289
  }
1284
1290
  return str;
1285
1291
  };
@@ -2720,8 +2726,9 @@
2720
2726
  *
2721
2727
  * @returns {string} The combined full path
2722
2728
  */
2723
- function buildFullPath(baseURL, requestedURL) {
2724
- if (baseURL && !isAbsoluteURL(requestedURL)) {
2729
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2730
+ var isRelativeUrl = !isAbsoluteURL(requestedURL);
2731
+ if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
2725
2732
  return combineURLs(baseURL, requestedURL);
2726
2733
  }
2727
2734
  return requestedURL;
@@ -3676,7 +3683,7 @@
3676
3683
  });
3677
3684
  }
3678
3685
 
3679
- var VERSION = "1.7.8";
3686
+ var VERSION = "1.8.0";
3680
3687
 
3681
3688
  var validators$1 = {};
3682
3689
 
@@ -3867,6 +3874,13 @@
3867
3874
  }, true);
3868
3875
  }
3869
3876
  }
3877
+
3878
+ // Set config.allowAbsoluteUrls
3879
+ if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
3880
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
3881
+ } else {
3882
+ config.allowAbsoluteUrls = true;
3883
+ }
3870
3884
  validator.assertOptions(config, {
3871
3885
  baseUrl: validators.spelling('baseURL'),
3872
3886
  withXsrfToken: validators.spelling('withXSRFToken')
@@ -3939,7 +3953,7 @@
3939
3953
  key: "getUri",
3940
3954
  value: function getUri(config) {
3941
3955
  config = mergeConfig(this.defaults, config);
3942
- var fullPath = buildFullPath(config.baseURL, config.url);
3956
+ var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3943
3957
  return buildURL(fullPath, config.params, config.paramsSerializer);
3944
3958
  }
3945
3959
  }]);