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/CHANGELOG.md +36 -6
- package/UPGRADE_GUIDE.md +1 -1
- package/dist/axios.js +4 -10
- package/dist/axios.map +1 -1
- package/dist/axios.min.js +2 -2
- package/dist/axios.min.map +1 -1
- package/index.d.ts +3 -3
- package/lib/adapters/xhr.js +1 -8
- package/lib/core/Axios.js +2 -1
- package/package.json +1 -1
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:
|
63
|
-
onDownloadProgress?: (progressEvent:
|
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;
|
package/lib/adapters/xhr.js
CHANGED
@@ -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
|
});
|