mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +03:00
chore(release): v1.7.0-beta.2 (#6403)
Co-authored-by: DigitalBrainJS <12586868+DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d57f03a77f
commit
b49aa8e3d8
Vendored
+21
-12
@@ -1,4 +1,4 @@
|
||||
// Axios v1.7.0-beta.1 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
// Axios v1.7.0-beta.2 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
'use strict';
|
||||
|
||||
const FormData$1 = require('form-data');
|
||||
@@ -2035,7 +2035,7 @@ function buildFullPath(baseURL, requestedURL) {
|
||||
return requestedURL;
|
||||
}
|
||||
|
||||
const VERSION = "1.7.0-beta.1";
|
||||
const VERSION = "1.7.0-beta.2";
|
||||
|
||||
function parseProtocol(url) {
|
||||
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
||||
@@ -3791,6 +3791,10 @@ isFetchSupported && (((res) => {
|
||||
})(new Response));
|
||||
|
||||
const getBodyLength = async (body) => {
|
||||
if (body == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(utils$1.isBlob(body)) {
|
||||
return body.size;
|
||||
}
|
||||
@@ -3849,12 +3853,15 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||
finished = true;
|
||||
};
|
||||
|
||||
try {
|
||||
if (onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head') {
|
||||
let requestContentLength = await resolveBodyLength(headers, data);
|
||||
let requestContentLength;
|
||||
|
||||
try {
|
||||
if (
|
||||
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
||||
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
||||
) {
|
||||
let _request = new Request(url, {
|
||||
method,
|
||||
method: 'POST',
|
||||
body: data,
|
||||
duplex: "half"
|
||||
});
|
||||
@@ -3865,10 +3872,12 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||
headers.setContentType(contentTypeHeader);
|
||||
}
|
||||
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
|
||||
requestContentLength,
|
||||
progressEventReducer(onUploadProgress)
|
||||
));
|
||||
if (_request.body) {
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, fetchProgressDecorator(
|
||||
requestContentLength,
|
||||
progressEventReducer(onUploadProgress)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
if (!utils$1.isString(withCredentials)) {
|
||||
@@ -3878,7 +3887,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||
request = new Request(url, {
|
||||
...fetchOptions,
|
||||
signal: composedSignal,
|
||||
method,
|
||||
method: method.toUpperCase(),
|
||||
headers: headers.normalize().toJSON(),
|
||||
body: data,
|
||||
duplex: "half",
|
||||
@@ -3892,7 +3901,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
|
||||
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
||||
const options = {};
|
||||
|
||||
Object.getOwnPropertyNames(response).forEach(prop => {
|
||||
['status', 'statusText', 'headers'].forEach(prop => {
|
||||
options[prop] = response[prop];
|
||||
});
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user