axios 1.7.6 → 1.7.7
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 +97 -68
- 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 +29 -9
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +29 -9
- 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 +30 -10
- package/dist/node/axios.cjs.map +1 -1
- package/lib/adapters/fetch.js +2 -2
- package/lib/adapters/http.js +1 -1
- package/lib/env/data.js +1 -1
- package/lib/helpers/trackStream.js +25 -5
- package/package.json +1 -1
package/dist/node/axios.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.7.
|
1
|
+
// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
const FormData$1 = require('form-data');
|
@@ -2071,7 +2071,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
2071
2071
|
return requestedURL;
|
2072
2072
|
}
|
2073
2073
|
|
2074
|
-
const VERSION = "1.7.
|
2074
|
+
const VERSION = "1.7.7";
|
2075
2075
|
|
2076
2076
|
function parseProtocol(url) {
|
2077
2077
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
@@ -2963,7 +2963,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
2963
2963
|
if (config.socketPath) {
|
2964
2964
|
options.socketPath = config.socketPath;
|
2965
2965
|
} else {
|
2966
|
-
options.hostname = parsed.hostname;
|
2966
|
+
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
2967
2967
|
options.port = parsed.port;
|
2968
2968
|
setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
|
2969
2969
|
}
|
@@ -3730,14 +3730,34 @@ const streamChunk = function* (chunk, chunkSize) {
|
|
3730
3730
|
}
|
3731
3731
|
};
|
3732
3732
|
|
3733
|
-
const readBytes = async function* (iterable, chunkSize
|
3734
|
-
for await (const chunk of iterable) {
|
3735
|
-
yield* streamChunk(
|
3733
|
+
const readBytes = async function* (iterable, chunkSize) {
|
3734
|
+
for await (const chunk of readStream(iterable)) {
|
3735
|
+
yield* streamChunk(chunk, chunkSize);
|
3736
3736
|
}
|
3737
3737
|
};
|
3738
3738
|
|
3739
|
-
const
|
3740
|
-
|
3739
|
+
const readStream = async function* (stream) {
|
3740
|
+
if (stream[Symbol.asyncIterator]) {
|
3741
|
+
yield* stream;
|
3742
|
+
return;
|
3743
|
+
}
|
3744
|
+
|
3745
|
+
const reader = stream.getReader();
|
3746
|
+
try {
|
3747
|
+
for (;;) {
|
3748
|
+
const {done, value} = await reader.read();
|
3749
|
+
if (done) {
|
3750
|
+
break;
|
3751
|
+
}
|
3752
|
+
yield value;
|
3753
|
+
}
|
3754
|
+
} finally {
|
3755
|
+
await reader.cancel();
|
3756
|
+
}
|
3757
|
+
};
|
3758
|
+
|
3759
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
3760
|
+
const iterator = readBytes(stream, chunkSize);
|
3741
3761
|
|
3742
3762
|
let bytes = 0;
|
3743
3763
|
let done;
|
@@ -3917,7 +3937,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|
3917
3937
|
progressEventReducer(asyncDecorator(onUploadProgress))
|
3918
3938
|
);
|
3919
3939
|
|
3920
|
-
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush
|
3940
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
3921
3941
|
}
|
3922
3942
|
}
|
3923
3943
|
|
@@ -3960,7 +3980,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
|
3960
3980
|
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
3961
3981
|
flush && flush();
|
3962
3982
|
unsubscribe && unsubscribe();
|
3963
|
-
}
|
3983
|
+
}),
|
3964
3984
|
options
|
3965
3985
|
);
|
3966
3986
|
}
|