2
0
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:
github-actions[bot]
2024-05-19 21:00:36 +03:00
committed by GitHub
parent d57f03a77f
commit b49aa8e3d8
17 changed files with 147 additions and 92 deletions
+21 -12
View File
@@ -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];
});
+1 -1
View File
File diff suppressed because one or more lines are too long