Skip to content

Commit

Permalink
chore(release): v1.4.0 (axios#5683)
Browse files Browse the repository at this point in the history
Co-authored-by: DigitalBrainJS <DigitalBrainJS@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and DigitalBrainJS committed Apr 27, 2023
1 parent d627610 commit 21a5ad3
Show file tree
Hide file tree
Showing 17 changed files with 136 additions and 40 deletions.
27 changes: 26 additions & 1 deletion CHANGELOG.md
@@ -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&#x3D;4&amp;s&#x3D;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&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Arthur Fiorette](https://github.com/arthurfiorette "+19/-19 (#5525 )")
- <img src="https://avatars.githubusercontent.com/u/43876655?v&#x3D;4&amp;s&#x3D;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)


Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion bower.json
@@ -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"
Expand Down
22 changes: 16 additions & 6 deletions dist/axios.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/axios.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/axios.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/axios.min.js.map

Large diffs are not rendered by default.

23 changes: 17 additions & 6 deletions dist/browser/axios.cjs
@@ -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) {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -716,7 +721,9 @@ var utils = {
ALPHABET,
generateString,
isSpecCompliantForm,
toJSONObject
toJSONObject,
isAsyncFn,
isThenable
};

/**
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -2620,7 +2631,7 @@ function mergeConfig(config1, config2) {
return config;
}

const VERSION = "1.3.6";
const VERSION = "1.4.0";

const validators$1 = {};

Expand Down
2 changes: 1 addition & 1 deletion dist/browser/axios.cjs.map

Large diffs are not rendered by default.

23 changes: 17 additions & 6 deletions dist/esm/axios.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/esm/axios.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/axios.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/axios.min.js.map

Large diffs are not rendered by default.

53 changes: 46 additions & 7 deletions dist/node/axios.cjs
@@ -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');
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -739,7 +744,9 @@ const utils = {
ALPHABET,
generateString,
isSpecCompliantForm,
toJSONObject
toJSONObject,
isAsyncFn,
isThenable
};

/**
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"]();

Expand Down Expand Up @@ -2776,6 +2809,8 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
agents: { http: config.httpAgent, https: config.httpsAgent },
auth,
protocol,
family,
lookup,
beforeRedirect: dispatchBeforeRedirect,
beforeRedirects: {}
};
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion dist/node/axios.cjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/env/data.js
@@ -1 +1 @@
export const VERSION = "1.3.6";
export const VERSION = "1.4.0";
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
@@ -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": {
Expand Down Expand Up @@ -212,4 +212,4 @@
"@commitlint/config-conventional"
]
}
}
}

0 comments on commit 21a5ad3

Please sign in to comment.