axios 1.6.5 → 1.6.7

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/dist/esm/axios.js CHANGED
@@ -1,4 +1,4 @@
1
- // Axios v1.6.5 Copyright (c) 2024 Matt Zabriskie and contributors
1
+ // Axios v1.6.7 Copyright (c) 2024 Matt Zabriskie and contributors
2
2
  function bind(fn, thisArg) {
3
3
  return function wrap() {
4
4
  return fn.apply(thisArg, arguments);
@@ -1436,9 +1436,6 @@ const defaults = {
1436
1436
  const isFormData = utils$1.isFormData(data);
1437
1437
 
1438
1438
  if (isFormData) {
1439
- if (!hasJSONContentType) {
1440
- return data;
1441
- }
1442
1439
  return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1443
1440
  }
1444
1441
 
@@ -2656,7 +2653,7 @@ function mergeConfig$1(config1, config2) {
2656
2653
  return config;
2657
2654
  }
2658
2655
 
2659
- const VERSION$1 = "1.6.5";
2656
+ const VERSION$1 = "1.6.7";
2660
2657
 
2661
2658
  const validators$1 = {};
2662
2659
 
@@ -2771,7 +2768,31 @@ class Axios$1 {
2771
2768
  *
2772
2769
  * @returns {Promise} The Promise to be fulfilled
2773
2770
  */
2774
- request(configOrUrl, config) {
2771
+ async request(configOrUrl, config) {
2772
+ try {
2773
+ return await this._request(configOrUrl, config);
2774
+ } catch (err) {
2775
+ if (err instanceof Error) {
2776
+ let dummy;
2777
+
2778
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error());
2779
+
2780
+ // slice off the Error: ... line
2781
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
2782
+
2783
+ if (!err.stack) {
2784
+ err.stack = stack;
2785
+ // match without the 2 top stack lines
2786
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
2787
+ err.stack += '\n' + stack;
2788
+ }
2789
+ }
2790
+
2791
+ throw err;
2792
+ }
2793
+ }
2794
+
2795
+ _request(configOrUrl, config) {
2775
2796
  /*eslint no-param-reassign:0*/
2776
2797
  // Allow for axios('example/url'[, config]) a la fetch API
2777
2798
  if (typeof configOrUrl === 'string') {