axios 1.2.0 → 1.2.1

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,36 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.1] - 2022-12-05
4
+
5
+ ### Changed
6
+ - feat(exports): export mergeConfig [#5151](https://github.com/axios/axios/pull/5151)
7
+
8
+ ### Fixed
9
+ - fix(CancelledError): include config [#4922](https://github.com/axios/axios/pull/4922)
10
+ - fix(general): removing multiple/trailing/leading whitespace [#5022](https://github.com/axios/axios/pull/5022)
11
+ - fix(headers): decompression for responses without Content-Length header [#5306](https://github.com/axios/axios/pull/5306)
12
+ - fix(webWorker): exception to sending form data in web worker [#5139](https://github.com/axios/axios/pull/5139)
13
+
14
+ ### Refactors
15
+ - refactor(types): AxiosProgressEvent.event type to any [#5308](https://github.com/axios/axios/pull/5308)
16
+ - refactor(types): add missing types for static AxiosError.from method [#4956](https://github.com/axios/axios/pull/4956)
17
+
18
+ ### Chores
19
+ - chore(docs): remove README link to non-existent upgrade guide [#5307](https://github.com/axios/axios/pull/5307)
20
+ - chore(docs): typo in issue template name [#5159](https://github.com/axios/axios/pull/5159)
21
+
22
+ ### Contributors to this release
23
+
24
+ - [](https://github.com/DigitalBrainJS)
25
+ - [](https://github.com/zachlysobey)
26
+ - [](https://github.com/kevincennis)
27
+ - [](https://github.com/phloose)
28
+ - [](https://github.com/secondl1ght)
29
+ - [](https://github.com/0x30)
30
+ - [](https://github.com/ovarn)
31
+ - [](https://github.com/arthurfiorette)
32
+ - [](https://github.com/0x30)
33
+
3
34
  ## [1.2.0] - 2022-11-10
4
35
 
5
36
  ### Changed
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  <p align="center">
10
10
  <a href="https://axios-http.com/"><b>Website</b></a> •
11
11
  <a href="https://axios-http.com/docs/intro"><b>Documentation</b></a>
12
- </p>
12
+ </p>
13
13
 
14
14
  <div align="center">
15
15
 
@@ -29,7 +29,7 @@
29
29
 
30
30
 
31
31
  </div>
32
-
32
+
33
33
  ## Table of Contents
34
34
 
35
35
  - [Features](#features)
@@ -1297,7 +1297,6 @@ You can use Gitpod, an online IDE(which is free for Open Source) for contributin
1297
1297
  ## Resources
1298
1298
 
1299
1299
  * [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
1300
- * [Upgrade Guide](https://github.com/axios/axios/blob/v1.x/UPGRADE_GUIDE.md)
1301
1300
  * [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md)
1302
1301
  * [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md)
1303
1302
  * [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md)
package/dist/axios.js CHANGED
@@ -1,4 +1,4 @@
1
- // Axios v1.2.0 Copyright (c) 2022 Matt Zabriskie and contributors
1
+ // Axios v1.2.1 Copyright (c) 2022 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) :
@@ -1212,6 +1212,19 @@
1212
1212
  }
1213
1213
  return typeof window !== 'undefined' && typeof document !== 'undefined';
1214
1214
  }();
1215
+
1216
+ /**
1217
+ * Determine if we're running in a standard browser webWorker environment
1218
+ *
1219
+ * Although the `isStandardBrowserEnv` method indicates that
1220
+ * `allows axios to run in a web worker`, the WebWorker will still be
1221
+ * filtered out due to its judgment standard
1222
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
1223
+ * This leads to a problem when axios post `FormData` in webWorker
1224
+ */
1225
+ var isStandardBrowserWebWorkerEnv = function () {
1226
+ return typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
1227
+ }();
1215
1228
  var platform = {
1216
1229
  isBrowser: true,
1217
1230
  classes: {
@@ -1220,6 +1233,7 @@
1220
1233
  Blob: Blob
1221
1234
  },
1222
1235
  isStandardBrowserEnv: isStandardBrowserEnv,
1236
+ isStandardBrowserWebWorkerEnv: isStandardBrowserWebWorkerEnv,
1223
1237
  protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
1224
1238
  };
1225
1239
 
@@ -2008,7 +2022,7 @@
2008
2022
  config.signal.removeEventListener('abort', onCanceled);
2009
2023
  }
2010
2024
  }
2011
- if (utils.isFormData(requestData) && platform.isStandardBrowserEnv) {
2025
+ if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
2012
2026
  requestHeaders.setContentType(false); // Let the browser set it
2013
2027
  }
2014
2028
 
@@ -2232,7 +2246,7 @@
2232
2246
  config.cancelToken.throwIfRequested();
2233
2247
  }
2234
2248
  if (config.signal && config.signal.aborted) {
2235
- throw new CanceledError();
2249
+ throw new CanceledError(null, config);
2236
2250
  }
2237
2251
  }
2238
2252
 
@@ -2377,7 +2391,7 @@
2377
2391
  return config;
2378
2392
  }
2379
2393
 
2380
- var VERSION = "1.2.0";
2394
+ var VERSION = "1.2.1";
2381
2395
 
2382
2396
  var validators$1 = {};
2383
2397
 
@@ -2824,6 +2838,9 @@
2824
2838
 
2825
2839
  // Expose isAxiosError
2826
2840
  axios.isAxiosError = isAxiosError;
2841
+
2842
+ // Expose mergeConfig
2843
+ axios.mergeConfig = mergeConfig;
2827
2844
  axios.AxiosHeaders = AxiosHeaders$1;
2828
2845
  axios.formToJSON = function (thing) {
2829
2846
  return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);