2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

chore(release): v1.3.1 (#5522)

Co-authored-by: DigitalBrainJS <DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-02-02 01:30:01 +02:00
committed by GitHub
parent 96d336f527
commit 54d3facb3b
17 changed files with 55 additions and 35 deletions
+17 -9
View File
@@ -1,4 +1,4 @@
// Axios v1.3.0 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.3.1 Copyright (c) 2023 Matt Zabriskie and contributors
'use strict';
const FormData$1 = require('form-data');
@@ -6,6 +6,7 @@ const url = require('url');
const proxyFromEnv = require('proxy-from-env');
const http = require('http');
const https = require('https');
const util = require('util');
const followRedirects = require('follow-redirects');
const zlib = require('zlib');
const stream = require('stream');
@@ -17,6 +18,7 @@ const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);
const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);
@@ -978,7 +980,7 @@ function toFormData(obj, formData, options) {
value = JSON.stringify(value);
} else if (
(utils.isArray(value) && isFlatArray(value)) ||
(utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
)) {
// eslint-disable-next-line no-param-reassign
key = removeBrackets(key);
@@ -1687,7 +1689,7 @@ class AxiosHeaders {
if (header) {
const key = utils.findKey(this, header);
return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
}
return false;
@@ -1946,7 +1948,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL;
}
const VERSION = "1.3.0";
const VERSION = "1.3.1";
function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -2510,7 +2512,8 @@ const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(pr
/*eslint consistent-return:0*/
const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
/*eslint no-async-promise-executor:0*/
return new Promise(async function dispatchHttpRequest(resolvePromise, rejectPromise) {
let data = config.data;
const responseType = config.responseType;
const responseEncoding = config.responseEncoding;
@@ -2601,7 +2604,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
convertedData = convertedData.toString(responseEncoding);
if (!responseEncoding || responseEncoding === 'utf8') {
data = utils.stripBOM(convertedData);
convertedData = utils.stripBOM(convertedData);
}
} else if (responseType === 'stream') {
convertedData = stream__default["default"].Readable.from(convertedData);
@@ -2651,9 +2654,14 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
// support for https://www.npmjs.com/package/form-data api
} else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
headers.set(data.getHeaders());
if (utils.isFunction(data.getLengthSync)) { // check if the undocumented API exists
const knownLength = data.getLengthSync();
!utils.isUndefined(knownLength) && headers.setContentLength(knownLength, false);
if (!headers.hasContentLength()) {
try {
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
headers.setContentLength(knownLength);
/*eslint no-empty:0*/
} catch (e) {
}
}
} else if (utils.isBlob(data)) {
data.size && headers.setContentType(data.type || 'application/octet-stream');
+1 -1
View File
File diff suppressed because one or more lines are too long