axios 1.6.6 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.7](https://github.com/axios/axios/compare/v1.6.6...v1.6.7) (2024-01-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * capture async stack only for rejections with native error objects; ([#6203](https://github.com/axios/axios/issues/6203)) ([1a08f90](https://github.com/axios/axios/commit/1a08f90f402336e4d00e9ee82f211c6adb1640b0))
9
+
10
+ ### Contributors to this release
11
+
12
+ - <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 "+30/-26 (#6203 )")
13
+ - <img src="https://avatars.githubusercontent.com/u/73059627?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [zhoulixiang](https://github.com/zh-lx "+0/-3 (#6186 )")
14
+
3
15
  ## [1.6.6](https://github.com/axios/axios/compare/v1.6.5...v1.6.6) (2024-01-24)
4
16
 
5
17
 
package/dist/axios.js CHANGED
@@ -1,4 +1,4 @@
1
- // Axios v1.6.6 Copyright (c) 2024 Matt Zabriskie and contributors
1
+ // Axios v1.6.7 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) :
@@ -1774,9 +1774,6 @@
1774
1774
  }
1775
1775
  var isFormData = utils$1.isFormData(data);
1776
1776
  if (isFormData) {
1777
- if (!hasJSONContentType) {
1778
- return data;
1779
- }
1780
1777
  return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1781
1778
  }
1782
1779
  if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data)) {
@@ -2841,7 +2838,7 @@
2841
2838
  return config;
2842
2839
  }
2843
2840
 
2844
- var VERSION = "1.6.6";
2841
+ var VERSION = "1.6.7";
2845
2842
 
2846
2843
  var validators$1 = {};
2847
2844
 
@@ -2949,7 +2946,7 @@
2949
2946
  key: "request",
2950
2947
  value: function () {
2951
2948
  var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(configOrUrl, config) {
2952
- var dummy;
2949
+ var dummy, stack;
2953
2950
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2954
2951
  while (1) {
2955
2952
  switch (_context.prev = _context.next) {
@@ -2962,20 +2959,20 @@
2962
2959
  case 6:
2963
2960
  _context.prev = 6;
2964
2961
  _context.t0 = _context["catch"](0);
2965
- dummy = {};
2966
- if (Error.captureStackTrace) {
2967
- Error.captureStackTrace(dummy);
2968
- } else {
2969
- dummy.stack = new Error().stack;
2970
- }
2971
- // slice off the Error: ... line
2972
- dummy.stack = dummy.stack.replace(/^.+\n/, '');
2973
- // match without the 2 top stack lines
2974
- if (!_context.t0.stack.endsWith(dummy.stack.replace(/^.+\n.+\n/, ''))) {
2975
- _context.t0.stack += '\n' + dummy.stack;
2962
+ if (_context.t0 instanceof Error) {
2963
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
2964
+
2965
+ // slice off the Error: ... line
2966
+ stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
2967
+ if (!_context.t0.stack) {
2968
+ _context.t0.stack = stack;
2969
+ // match without the 2 top stack lines
2970
+ } else if (stack && !String(_context.t0.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
2971
+ _context.t0.stack += '\n' + stack;
2972
+ }
2976
2973
  }
2977
2974
  throw _context.t0;
2978
- case 13:
2975
+ case 10:
2979
2976
  case "end":
2980
2977
  return _context.stop();
2981
2978
  }