axios 0.20.0 → 0.21.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/index.d.ts CHANGED
@@ -59,10 +59,10 @@ export interface AxiosRequestConfig {
59
59
  responseType?: ResponseType;
60
60
  xsrfCookieName?: string;
61
61
  xsrfHeaderName?: string;
62
- onUploadProgress?: (progressEvent: ProgressEvent) => void;
63
- onDownloadProgress?: (progressEvent: ProgressEvent) => void;
62
+ onUploadProgress?: (progressEvent: any) => void;
63
+ onDownloadProgress?: (progressEvent: any) => void;
64
64
  maxContentLength?: number;
65
- validateStatus?: ((status: number) => boolean | null);
65
+ validateStatus?: ((status: number) => boolean) | null;
66
66
  maxBodyLength?: number;
67
67
  maxRedirects?: number;
68
68
  socketPath?: string | null;
@@ -18,19 +18,12 @@ module.exports = function xhrAdapter(config) {
18
18
  delete requestHeaders['Content-Type']; // Let the browser set it
19
19
  }
20
20
 
21
- if (
22
- (utils.isBlob(requestData) || utils.isFile(requestData)) &&
23
- requestData.type
24
- ) {
25
- delete requestHeaders['Content-Type']; // Let the browser set it
26
- }
27
-
28
21
  var request = new XMLHttpRequest();
29
22
 
30
23
  // HTTP basic authentication
31
24
  if (config.auth) {
32
25
  var username = config.auth.username || '';
33
- var password = unescape(encodeURIComponent(config.auth.password)) || '';
26
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
34
27
  requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
35
28
  }
36
29
 
package/lib/core/Axios.js CHANGED
@@ -75,7 +75,8 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
75
75
  Axios.prototype[method] = function(url, config) {
76
76
  return this.request(mergeConfig(config || {}, {
77
77
  method: method,
78
- url: url
78
+ url: url,
79
+ data: (config || {}).data
79
80
  }));
80
81
  };
81
82
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {