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/browser/axios.cjs
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
|
'use strict';
|
3
3
|
|
4
4
|
function bind(fn, thisArg) {
|
@@ -2722,6 +2722,10 @@ isFetchSupported && (((res) => {
|
|
2722
2722
|
})(new Response));
|
2723
2723
|
|
2724
2724
|
const getBodyLength = async (body) => {
|
2725
|
+
if (body == null) {
|
2726
|
+
return 0;
|
2727
|
+
}
|
2728
|
+
|
2725
2729
|
if(utils$1.isBlob(body)) {
|
2726
2730
|
return body.size;
|
2727
2731
|
}
|
@@ -2780,12 +2784,15 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
2780
2784
|
finished = true;
|
2781
2785
|
};
|
2782
2786
|
|
2783
|
-
|
2784
|
-
if (onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head') {
|
2785
|
-
let requestContentLength = await resolveBodyLength(headers, data);
|
2787
|
+
let requestContentLength;
|
2786
2788
|
|
2789
|
+
try {
|
2790
|
+
if (
|
2791
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
2792
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
2793
|
+
) {
|
2787
2794
|
let _request = new Request(url, {
|
2788
|
-
method,
|
2795
|
+
method: 'POST',
|
2789
2796
|
body: data,
|
2790
2797
|
duplex: "half"
|
2791
2798
|
});
|
@@ -2796,10 +2803,12 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
2796
2803
|
headers.setContentType(contentTypeHeader);
|
2797
2804
|
}
|
2798
2805
|
|
2799
|
-
|
2800
|
-
|
2801
|
-
|
2802
|
-
|
2806
|
+
if (_request.body) {
|
2807
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
|
2808
|
+
requestContentLength,
|
2809
|
+
progressEventReducer(onUploadProgress)
|
2810
|
+
));
|
2811
|
+
}
|
2803
2812
|
}
|
2804
2813
|
|
2805
2814
|
if (!utils$1.isString(withCredentials)) {
|
@@ -2809,7 +2818,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
2809
2818
|
request = new Request(url, {
|
2810
2819
|
...fetchOptions,
|
2811
2820
|
signal: composedSignal,
|
2812
|
-
method,
|
2821
|
+
method: method.toUpperCase(),
|
2813
2822
|
headers: headers.normalize().toJSON(),
|
2814
2823
|
body: data,
|
2815
2824
|
duplex: "half",
|
@@ -2823,7 +2832,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
2823
2832
|
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
2824
2833
|
const options = {};
|
2825
2834
|
|
2826
|
-
|
2835
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
2827
2836
|
options[prop] = response[prop];
|
2828
2837
|
});
|
2829
2838
|
|
@@ -3019,7 +3028,7 @@ function dispatchRequest(config) {
|
|
3019
3028
|
});
|
3020
3029
|
}
|
3021
3030
|
|
3022
|
-
const VERSION = "1.7.0-beta.
|
3031
|
+
const VERSION = "1.7.0-beta.2";
|
3023
3032
|
|
3024
3033
|
const validators$1 = {};
|
3025
3034
|
|