Skip to content

Commit 54d3fac

Browse files
chore(release): v1.3.1 (axios#5522)
Co-authored-by: DigitalBrainJS <[email protected]>
1 parent 96d336f commit 54d3fac

17 files changed

+55
-35
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [1.3.1](https://github.com/axios/axios/compare/v1.3.0...v1.3.1) (2023-02-01)
4+
5+
6+
### Bug Fixes
7+
8+
* **formdata:** add hotfix to use the asynchronous API to compute the content-length header value; ([#5521](https://github.com/axios/axios/issues/5521)) ([96d336f](https://github.com/axios/axios/commit/96d336f527619f21da012fe1f117eeb53e5a2120))
9+
* **serializer:** fixed serialization of array-like objects; ([#5518](https://github.com/axios/axios/issues/5518)) ([08104c0](https://github.com/axios/axios/commit/08104c028c0f9353897b1b6691d74c440fd0c32d))
10+
11+
### Contributors to this release
12+
13+
- <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 "+27/-8 (#5521 #5518 )")
14+
315
# [1.3.0](https://github.com/axios/axios/compare/v1.2.6...v1.3.0) (2023-01-31)
416

517

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "axios",
33
"main": "./dist/axios.js",
4-
"version": "1.3.0",
4+
"version": "1.3.1",
55
"homepage": "https://axios-http.com",
66
"authors": [
77
"Matt Zabriskie"

dist/axios.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/axios.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/axios.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/axios.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/browser/axios.cjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Axios v1.3.0 Copyright (c) 2023 Matt Zabriskie and contributors
1+
// Axios v1.3.1 Copyright (c) 2023 Matt Zabriskie and contributors
22
'use strict';
33

44
function bind(fn, thisArg) {
@@ -960,7 +960,7 @@ function toFormData(obj, formData, options) {
960960
value = JSON.stringify(value);
961961
} else if (
962962
(utils.isArray(value) && isFlatArray(value)) ||
963-
(utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))
963+
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
964964
)) {
965965
// eslint-disable-next-line no-param-reassign
966966
key = removeBrackets(key);
@@ -1722,7 +1722,7 @@ class AxiosHeaders {
17221722
if (header) {
17231723
const key = utils.findKey(this, header);
17241724

1725-
return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1725+
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
17261726
}
17271727

17281728
return false;
@@ -2612,7 +2612,7 @@ function mergeConfig(config1, config2) {
26122612
return config;
26132613
}
26142614

2615-
const VERSION = "1.3.0";
2615+
const VERSION = "1.3.1";
26162616

26172617
const validators$1 = {};
26182618

dist/browser/axios.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/esm/axios.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/esm/axios.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/esm/axios.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/esm/axios.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/node/axios.cjs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// Axios v1.3.0 Copyright (c) 2023 Matt Zabriskie and contributors
1+
// Axios v1.3.1 Copyright (c) 2023 Matt Zabriskie and contributors
22
'use strict';
33

44
const FormData$1 = require('form-data');
55
const url = require('url');
66
const proxyFromEnv = require('proxy-from-env');
77
const http = require('http');
88
const https = require('https');
9+
const util = require('util');
910
const followRedirects = require('follow-redirects');
1011
const zlib = require('zlib');
1112
const stream = require('stream');
@@ -17,6 +18,7 @@ const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1);
1718
const url__default = /*#__PURE__*/_interopDefaultLegacy(url);
1819
const http__default = /*#__PURE__*/_interopDefaultLegacy(http);
1920
const https__default = /*#__PURE__*/_interopDefaultLegacy(https);
21+
const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
2022
const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects);
2123
const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
2224
const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream);
@@ -978,7 +980,7 @@ function toFormData(obj, formData, options) {
978980
value = JSON.stringify(value);
979981
} else if (
980982
(utils.isArray(value) && isFlatArray(value)) ||
981-
(utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))
983+
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
982984
)) {
983985
// eslint-disable-next-line no-param-reassign
984986
key = removeBrackets(key);
@@ -1687,7 +1689,7 @@ class AxiosHeaders {
16871689
if (header) {
16881690
const key = utils.findKey(this, header);
16891691

1690-
return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1692+
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
16911693
}
16921694

16931695
return false;
@@ -1946,7 +1948,7 @@ function buildFullPath(baseURL, requestedURL) {
19461948
return requestedURL;
19471949
}
19481950

1949-
const VERSION = "1.3.0";
1951+
const VERSION = "1.3.1";
19501952

19511953
function parseProtocol(url) {
19521954
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -2510,7 +2512,8 @@ const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(pr
25102512

25112513
/*eslint consistent-return:0*/
25122514
const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
2513-
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
2515+
/*eslint no-async-promise-executor:0*/
2516+
return new Promise(async function dispatchHttpRequest(resolvePromise, rejectPromise) {
25142517
let data = config.data;
25152518
const responseType = config.responseType;
25162519
const responseEncoding = config.responseEncoding;
@@ -2601,7 +2604,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
26012604
convertedData = convertedData.toString(responseEncoding);
26022605

26032606
if (!responseEncoding || responseEncoding === 'utf8') {
2604-
data = utils.stripBOM(convertedData);
2607+
convertedData = utils.stripBOM(convertedData);
26052608
}
26062609
} else if (responseType === 'stream') {
26072610
convertedData = stream__default["default"].Readable.from(convertedData);
@@ -2651,9 +2654,14 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
26512654
// support for https://www.npmjs.com/package/form-data api
26522655
} else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
26532656
headers.set(data.getHeaders());
2654-
if (utils.isFunction(data.getLengthSync)) { // check if the undocumented API exists
2655-
const knownLength = data.getLengthSync();
2656-
!utils.isUndefined(knownLength) && headers.setContentLength(knownLength, false);
2657+
2658+
if (!headers.hasContentLength()) {
2659+
try {
2660+
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
2661+
headers.setContentLength(knownLength);
2662+
/*eslint no-empty:0*/
2663+
} catch (e) {
2664+
}
26572665
}
26582666
} else if (utils.isBlob(data)) {
26592667
data.size && headers.setContentType(data.type || 'application/octet-stream');

dist/node/axios.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/env/data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = "1.3.0";
1+
export const VERSION = "1.3.1";

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "axios",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Promise based HTTP client for the browser and node.js",
55
"main": "index.js",
66
"exports": {
@@ -204,4 +204,4 @@
204204
"@commitlint/config-conventional"
205205
]
206206
}
207-
}
207+
}

0 commit comments

Comments
 (0)