axios 1.7.0-beta.1 → 1.7.0-beta.2
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 +13 -0
- package/dist/axios.js +55 -40
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +21 -12
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +21 -12
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +21 -12
- package/dist/node/axios.cjs.map +1 -1
- package/lib/adapters/fetch.js +19 -10
- package/lib/env/data.js +1 -1
- package/package.json +1 -1
package/dist/esm/axios.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.7.0-beta.
|
1
|
+
// Axios v1.7.0-beta.2 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);
|
@@ -2720,6 +2720,10 @@ isFetchSupported && (((res) => {
|
|
2720
2720
|
})(new Response));
|
2721
2721
|
|
2722
2722
|
const getBodyLength = async (body) => {
|
2723
|
+
if (body == null) {
|
2724
|
+
return 0;
|
2725
|
+
}
|
2726
|
+
|
2723
2727
|
if(utils$1.isBlob(body)) {
|
2724
2728
|
return body.size;
|
2725
2729
|
}
|
@@ -2778,12 +2782,15 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|
2778
2782
|
finished = true;
|
2779
2783
|
};
|
2780
2784
|
|
2781
|
-
|
2782
|
-
if (onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head') {
|
2783
|
-
let requestContentLength = await resolveBodyLength(headers, data);
|
2785
|
+
let requestContentLength;
|
2784
2786
|
|
2787
|
+
try {
|
2788
|
+
if (
|
2789
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
2790
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
2791
|
+
) {
|
2785
2792
|
let _request = new Request(url, {
|
2786
|
-
method,
|
2793
|
+
method: 'POST',
|
2787
2794
|
body: data,
|
2788
2795
|
duplex: "half"
|
2789
2796
|
});
|
@@ -2794,10 +2801,12 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|
2794
2801
|
headers.setContentType(contentTypeHeader);
|
2795
2802
|
}
|
2796
2803
|
|
2797
|
-
|
2798
|
-
|
2799
|
-
|
2800
|
-
|
2804
|
+
if (_request.body) {
|
2805
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
|
2806
|
+
requestContentLength,
|
2807
|
+
progressEventReducer(onUploadProgress)
|
2808
|
+
));
|
2809
|
+
}
|
2801
2810
|
}
|
2802
2811
|
|
2803
2812
|
if (!utils$1.isString(withCredentials)) {
|
@@ -2807,7 +2816,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|
2807
2816
|
request = new Request(url, {
|
2808
2817
|
...fetchOptions,
|
2809
2818
|
signal: composedSignal,
|
2810
|
-
method,
|
2819
|
+
method: method.toUpperCase(),
|
2811
2820
|
headers: headers.normalize().toJSON(),
|
2812
2821
|
body: data,
|
2813
2822
|
duplex: "half",
|
@@ -2821,7 +2830,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|
2821
2830
|
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
2822
2831
|
const options = {};
|
2823
2832
|
|
2824
|
-
|
2833
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
2825
2834
|
options[prop] = response[prop];
|
2826
2835
|
});
|
2827
2836
|
|
@@ -3017,7 +3026,7 @@ function dispatchRequest(config) {
|
|
3017
3026
|
});
|
3018
3027
|
}
|
3019
3028
|
|
3020
|
-
const VERSION$1 = "1.7.0-beta.
|
3029
|
+
const VERSION$1 = "1.7.0-beta.2";
|
3021
3030
|
|
3022
3031
|
const validators$1 = {};
|
3023
3032
|
|