mirror of
https://github.com/tenrok/axios.git
synced 2026-06-14 18:42:33 +03:00
chore(release): v1.4.0 (#5683)
Co-authored-by: DigitalBrainJS <DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d627610d0c
commit
21a5ad34c4
+26
-1
@@ -1,5 +1,30 @@
|
||||
# Changelog
|
||||
|
||||
# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1))
|
||||
* **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb))
|
||||
* **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e))
|
||||
|
||||
### Contributors to this release
|
||||
|
||||
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+151/-16 (#5684 #5339 #5679 #5678 #5677 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/47537704?v=4&s=18" alt="avatar" width="18"/> [Arthur Fiorette](https://github.com/arthurfiorette "+19/-19 (#5525 )")
|
||||
- <img src="https://avatars.githubusercontent.com/u/43876655?v=4&s=18" alt="avatar" width="18"/> [PIYUSH NEGI](https://github.com/npiyush97 "+2/-18 (#5670 )")
|
||||
|
||||
## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19)
|
||||
|
||||
|
||||
@@ -514,4 +539,4 @@
|
||||
- [Marco Weber](https://github.com/mrcwbr)
|
||||
- [Luca Pizzini](https://github.com/lpizzinidev)
|
||||
- [Willian Agostini](https://github.com/WillianAgostini)
|
||||
- [Huyen Nguyen](https://github.com/huyenltnguyen)
|
||||
- [Huyen Nguyen](https://github.com/huyenltnguyen)
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"main": "./dist/axios.js",
|
||||
"version": "1.3.6",
|
||||
"version": "1.4.0",
|
||||
"homepage": "https://axios-http.com",
|
||||
"authors": [
|
||||
"Matt Zabriskie"
|
||||
|
||||
Vendored
+16
-6
@@ -1,4 +1,4 @@
|
||||
// Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
@@ -722,6 +722,10 @@
|
||||
};
|
||||
return visit(obj, 0);
|
||||
};
|
||||
var isAsyncFn = kindOfTest('AsyncFunction');
|
||||
var isThenable = function isThenable(thing) {
|
||||
return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing["catch"]);
|
||||
};
|
||||
var utils = {
|
||||
isArray: isArray,
|
||||
isArrayBuffer: isArrayBuffer,
|
||||
@@ -772,7 +776,9 @@
|
||||
ALPHABET: ALPHABET,
|
||||
generateString: generateString,
|
||||
isSpecCompliantForm: isSpecCompliantForm,
|
||||
toJSONObject: toJSONObject
|
||||
toJSONObject: toJSONObject,
|
||||
isAsyncFn: isAsyncFn,
|
||||
isThenable: isThenable
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -2061,8 +2067,12 @@
|
||||
config.signal.removeEventListener('abort', onCanceled);
|
||||
}
|
||||
}
|
||||
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
if (utils.isFormData(requestData)) {
|
||||
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
} else {
|
||||
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
|
||||
}
|
||||
}
|
||||
|
||||
var request = new XMLHttpRequest();
|
||||
@@ -2422,7 +2432,7 @@
|
||||
return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
|
||||
}
|
||||
};
|
||||
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
||||
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
var merge = mergeMap[prop] || mergeDeepProperties;
|
||||
var configValue = merge(config1[prop], config2[prop], prop);
|
||||
utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
||||
@@ -2430,7 +2440,7 @@
|
||||
return config;
|
||||
}
|
||||
|
||||
var VERSION = "1.3.6";
|
||||
var VERSION = "1.4.0";
|
||||
|
||||
var validators$1 = {};
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+17
-6
@@ -1,4 +1,4 @@
|
||||
// Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||
'use strict';
|
||||
|
||||
function bind(fn, thisArg) {
|
||||
@@ -667,6 +667,11 @@ const toJSONObject = (obj) => {
|
||||
return visit(obj, 0);
|
||||
};
|
||||
|
||||
const isAsyncFn = kindOfTest('AsyncFunction');
|
||||
|
||||
const isThenable = (thing) =>
|
||||
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
||||
|
||||
var utils = {
|
||||
isArray,
|
||||
isArrayBuffer,
|
||||
@@ -716,7 +721,9 @@ var utils = {
|
||||
ALPHABET,
|
||||
generateString,
|
||||
isSpecCompliantForm,
|
||||
toJSONObject
|
||||
toJSONObject,
|
||||
isAsyncFn,
|
||||
isThenable
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -2204,8 +2211,12 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
||||
}
|
||||
}
|
||||
|
||||
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
if (utils.isFormData(requestData)) {
|
||||
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
} else {
|
||||
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
|
||||
}
|
||||
}
|
||||
|
||||
let request = new XMLHttpRequest();
|
||||
@@ -2611,7 +2622,7 @@ function mergeConfig(config1, config2) {
|
||||
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
||||
};
|
||||
|
||||
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
||||
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
const merge = mergeMap[prop] || mergeDeepProperties;
|
||||
const configValue = merge(config1[prop], config2[prop], prop);
|
||||
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
||||
@@ -2620,7 +2631,7 @@ function mergeConfig(config1, config2) {
|
||||
return config;
|
||||
}
|
||||
|
||||
const VERSION = "1.3.6";
|
||||
const VERSION = "1.4.0";
|
||||
|
||||
const validators$1 = {};
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+17
-6
@@ -1,4 +1,4 @@
|
||||
// Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||
function bind(fn, thisArg) {
|
||||
return function wrap() {
|
||||
return fn.apply(thisArg, arguments);
|
||||
@@ -665,6 +665,11 @@ const toJSONObject = (obj) => {
|
||||
return visit(obj, 0);
|
||||
};
|
||||
|
||||
const isAsyncFn = kindOfTest('AsyncFunction');
|
||||
|
||||
const isThenable = (thing) =>
|
||||
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
||||
|
||||
const utils = {
|
||||
isArray,
|
||||
isArrayBuffer,
|
||||
@@ -714,7 +719,9 @@ const utils = {
|
||||
ALPHABET,
|
||||
generateString,
|
||||
isSpecCompliantForm,
|
||||
toJSONObject
|
||||
toJSONObject,
|
||||
isAsyncFn,
|
||||
isThenable
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -2202,8 +2209,12 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
||||
}
|
||||
}
|
||||
|
||||
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
if (utils.isFormData(requestData)) {
|
||||
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
} else {
|
||||
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
|
||||
}
|
||||
}
|
||||
|
||||
let request = new XMLHttpRequest();
|
||||
@@ -2609,7 +2620,7 @@ function mergeConfig$1(config1, config2) {
|
||||
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
||||
};
|
||||
|
||||
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
||||
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
const merge = mergeMap[prop] || mergeDeepProperties;
|
||||
const configValue = merge(config1[prop], config2[prop], prop);
|
||||
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
||||
@@ -2618,7 +2629,7 @@ function mergeConfig$1(config1, config2) {
|
||||
return config;
|
||||
}
|
||||
|
||||
const VERSION$1 = "1.3.6";
|
||||
const VERSION$1 = "1.4.0";
|
||||
|
||||
const validators$1 = {};
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+46
-7
@@ -1,4 +1,4 @@
|
||||
// Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||
'use strict';
|
||||
|
||||
const FormData$1 = require('form-data');
|
||||
@@ -690,6 +690,11 @@ const toJSONObject = (obj) => {
|
||||
return visit(obj, 0);
|
||||
};
|
||||
|
||||
const isAsyncFn = kindOfTest('AsyncFunction');
|
||||
|
||||
const isThenable = (thing) =>
|
||||
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
||||
|
||||
const utils = {
|
||||
isArray,
|
||||
isArrayBuffer,
|
||||
@@ -739,7 +744,9 @@ const utils = {
|
||||
ALPHABET,
|
||||
generateString,
|
||||
isSpecCompliantForm,
|
||||
toJSONObject
|
||||
toJSONObject,
|
||||
isAsyncFn,
|
||||
isThenable
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1954,7 +1961,7 @@ function buildFullPath(baseURL, requestedURL) {
|
||||
return requestedURL;
|
||||
}
|
||||
|
||||
const VERSION = "1.3.6";
|
||||
const VERSION = "1.4.0";
|
||||
|
||||
function parseProtocol(url) {
|
||||
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
||||
@@ -2424,6 +2431,21 @@ class ZlibHeaderTransformStream extends stream__default["default"].Transform {
|
||||
|
||||
const ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
|
||||
|
||||
const callbackify = (fn, reducer) => {
|
||||
return utils.isAsyncFn(fn) ? function (...args) {
|
||||
const cb = args.pop();
|
||||
fn.apply(this, args).then((value) => {
|
||||
try {
|
||||
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
||||
} catch (err) {
|
||||
cb(err);
|
||||
}
|
||||
}, cb);
|
||||
} : fn;
|
||||
};
|
||||
|
||||
const callbackify$1 = callbackify;
|
||||
|
||||
const zlibOptions = {
|
||||
flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
|
||||
finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
|
||||
@@ -2546,13 +2568,24 @@ const wrapAsync = (asyncExecutor) => {
|
||||
/*eslint consistent-return:0*/
|
||||
const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
||||
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
||||
let {data} = config;
|
||||
let {data, lookup, family} = config;
|
||||
const {responseType, responseEncoding} = config;
|
||||
const method = config.method.toUpperCase();
|
||||
let isDone;
|
||||
let rejected = false;
|
||||
let req;
|
||||
|
||||
if (lookup && utils.isAsyncFn(lookup)) {
|
||||
lookup = callbackify$1(lookup, (entry) => {
|
||||
if(utils.isString(entry)) {
|
||||
entry = [entry, entry.indexOf('.') < 0 ? 6 : 4];
|
||||
} else if (!utils.isArray(entry)) {
|
||||
throw new TypeError('lookup async function must return an array [ip: string, family: number]]')
|
||||
}
|
||||
return entry;
|
||||
});
|
||||
}
|
||||
|
||||
// temporary internal emitter until the AxiosRequest class will be implemented
|
||||
const emitter = new EventEmitter__default["default"]();
|
||||
|
||||
@@ -2776,6 +2809,8 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
||||
agents: { http: config.httpAgent, https: config.httpsAgent },
|
||||
auth,
|
||||
protocol,
|
||||
family,
|
||||
lookup,
|
||||
beforeRedirect: dispatchBeforeRedirect,
|
||||
beforeRedirects: {}
|
||||
};
|
||||
@@ -3205,8 +3240,12 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
||||
}
|
||||
}
|
||||
|
||||
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
if (utils.isFormData(requestData)) {
|
||||
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
|
||||
requestHeaders.setContentType(false); // Let the browser set it
|
||||
} else {
|
||||
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
|
||||
}
|
||||
}
|
||||
|
||||
let request = new XMLHttpRequest();
|
||||
@@ -3612,7 +3651,7 @@ function mergeConfig(config1, config2) {
|
||||
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
||||
};
|
||||
|
||||
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
||||
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
||||
const merge = mergeMap[prop] || mergeDeepProperties;
|
||||
const configValue = merge(config1[prop], config2[prop], prop);
|
||||
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
export const VERSION = "1.3.6";
|
||||
export const VERSION = "1.4.0";
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"version": "1.3.6",
|
||||
"version": "1.4.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "axios",
|
||||
"version": "1.3.6",
|
||||
"version": "1.4.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.0",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "axios",
|
||||
"version": "1.3.6",
|
||||
"version": "1.4.0",
|
||||
"description": "Promise based HTTP client for the browser and node.js",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
@@ -212,4 +212,4 @@
|
||||
"@commitlint/config-conventional"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user