2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

chore: release 1.1.3

This commit is contained in:
Jay
2022-10-15 15:43:01 +02:00
parent b0ebf9fcac
commit 9bd53214f6
15 changed files with 657 additions and 830 deletions
+36 -1
View File
@@ -217,4 +217,39 @@
### Contributors to this release ### Contributors to this release
- [Jason Saayman](https://github.com/jasonsaayman) - [Jason Saayman](https://github.com/jasonsaayman)
## [1.1.3] - 2022-10-15
### Added
Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113)
### Fixed
Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109)
Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108)
Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097)
Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103)
Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060)
Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085)
### Chores
docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046)
chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054)
chore: update issue template [#5061](https://github.com/axios/axios/pull/5061)
chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084)
### Contributors to this release
- [Jason Saayman](https://github.com/jasonsaayman)
- [scarf](https://github.com/scarf005)
- [Lenz Weber-Tronic](https://github.com/phryneas)
- [Arvindh](https://github.com/itsarvindh)
- [Félix Legrelle](https://github.com/FelixLgr)
- [Patrick Petrovic](https://github.com/ppati000)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
- [littledian](https://github.com/littledian)
- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime)
- [Salman Shaikh](https://github.com/salmannotkhan)
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "axios", "name": "axios",
"main": "./dist/axios.js", "main": "./dist/axios.js",
"version": "1.1.2", "version": "1.1.3",
"homepage": "https://axios-http.com", "homepage": "https://axios-http.com",
"authors": [ "authors": [
"Matt Zabriskie" "Matt Zabriskie"
+221 -484
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+35 -27
View File
@@ -1,4 +1,4 @@
// Axios v1.1.2 Copyright (c) 2022 Matt Zabriskie and contributors // Axios v1.1.3 Copyright (c) 2022 Matt Zabriskie and contributors
function bind(fn, thisArg) { function bind(fn, thisArg) {
return function wrap() { return function wrap() {
return fn.apply(thisArg, arguments); return fn.apply(thisArg, arguments);
@@ -877,7 +877,7 @@ function toFormData(obj, formData, options) {
key = removeBrackets(key); key = removeBrackets(key);
arr.forEach(function each(el, index) { arr.forEach(function each(el, index) {
!utils.isUndefined(el) && formData.append( !(utils.isUndefined(el) || el === null) && formData.append(
// eslint-disable-next-line no-nested-ternary // eslint-disable-next-line no-nested-ternary
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
convertValue(el) convertValue(el)
@@ -914,7 +914,7 @@ function toFormData(obj, formData, options) {
stack.push(value); stack.push(value);
utils.forEach(value, function each(el, key) { utils.forEach(value, function each(el, key) {
const result = !utils.isUndefined(el) && visitor.call( const result = !(utils.isUndefined(el) || el === null) && visitor.call(
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
); );
@@ -1020,21 +1020,28 @@ function buildURL(url, params, options) {
if (!params) { if (!params) {
return url; return url;
} }
const hashmarkIndex = url.indexOf('#');
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
const _encode = options && options.encode || encode; const _encode = options && options.encode || encode;
const serializerParams = utils.isURLSearchParams(params) ? const serializeFn = options && options.serialize;
params.toString() :
new AxiosURLSearchParams(params, options).toString(_encode);
if (serializerParams) { let serializedParams;
url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;
if (serializeFn) {
serializedParams = serializeFn(params, options);
} else {
serializedParams = utils.isURLSearchParams(params) ?
params.toString() :
new AxiosURLSearchParams(params, options).toString(_encode);
}
if (serializedParams) {
const hashmarkIndex = url.indexOf("#");
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
} }
return url; return url;
@@ -1525,7 +1532,7 @@ function normalizeValue(value) {
return value; return value;
} }
return String(value); return utils.isArray(value) ? value.map(normalizeValue) : String(value);
} }
function parseTokens(str) { function parseTokens(str) {
@@ -1612,13 +1619,7 @@ Object.assign(AxiosHeaders.prototype, {
return; return;
} }
if (utils.isArray(_value)) { self[key || _header] = normalizeValue(_value);
_value = _value.map(normalizeValue);
} else {
_value = normalizeValue(_value);
}
self[key || _header] = _value;
} }
if (utils.isPlainObject(header)) { if (utils.isPlainObject(header)) {
@@ -1732,13 +1733,13 @@ Object.assign(AxiosHeaders.prototype, {
return this; return this;
}, },
toJSON: function() { toJSON: function(asStrings) {
const obj = Object.create(null); const obj = Object.create(null);
utils.forEach(Object.assign({}, this[$defaults] || null, this), utils.forEach(Object.assign({}, this[$defaults] || null, this),
(value, header) => { (value, header) => {
if (value == null || value === false) return; if (value == null || value === false) return;
obj[header] = utils.isArray(value) ? value.join(', ') : value; obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value;
}); });
return obj; return obj;
@@ -2461,7 +2462,7 @@ function mergeConfig(config1, config2) {
return config; return config;
} }
const VERSION = "1.1.2"; const VERSION = "1.1.3";
const validators$1 = {}; const validators$1 = {};
@@ -2588,7 +2589,7 @@ class Axios {
config = mergeConfig(this.defaults, config); config = mergeConfig(this.defaults, config);
const transitional = config.transitional; const {transitional, paramsSerializer} = config;
if (transitional !== undefined) { if (transitional !== undefined) {
validator.assertOptions(transitional, { validator.assertOptions(transitional, {
@@ -2598,6 +2599,13 @@ class Axios {
}, false); }, false);
} }
if (paramsSerializer !== undefined) {
validator.assertOptions(paramsSerializer, {
encode: validators.function,
serialize: validators.function
}, true);
}
// Set config.method // Set config.method
config.method = (config.method || this.defaults.method || 'get').toLowerCase(); config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+40 -31
View File
@@ -1,4 +1,4 @@
// Axios v1.1.2 Copyright (c) 2022 Matt Zabriskie and contributors // Axios v1.1.3 Copyright (c) 2022 Matt Zabriskie and contributors
'use strict'; 'use strict';
const FormData$1 = require('form-data'); const FormData$1 = require('form-data');
@@ -897,7 +897,7 @@ function toFormData(obj, formData, options) {
key = removeBrackets(key); key = removeBrackets(key);
arr.forEach(function each(el, index) { arr.forEach(function each(el, index) {
!utils.isUndefined(el) && formData.append( !(utils.isUndefined(el) || el === null) && formData.append(
// eslint-disable-next-line no-nested-ternary // eslint-disable-next-line no-nested-ternary
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
convertValue(el) convertValue(el)
@@ -934,7 +934,7 @@ function toFormData(obj, formData, options) {
stack.push(value); stack.push(value);
utils.forEach(value, function each(el, key) { utils.forEach(value, function each(el, key) {
const result = !utils.isUndefined(el) && visitor.call( const result = !(utils.isUndefined(el) || el === null) && visitor.call(
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
); );
@@ -1040,21 +1040,28 @@ function buildURL(url, params, options) {
if (!params) { if (!params) {
return url; return url;
} }
const hashmarkIndex = url.indexOf('#');
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
const _encode = options && options.encode || encode; const _encode = options && options.encode || encode;
const serializerParams = utils.isURLSearchParams(params) ? const serializeFn = options && options.serialize;
params.toString() :
new AxiosURLSearchParams(params, options).toString(_encode);
if (serializerParams) { let serializedParams;
url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;
if (serializeFn) {
serializedParams = serializeFn(params, options);
} else {
serializedParams = utils.isURLSearchParams(params) ?
params.toString() :
new AxiosURLSearchParams(params, options).toString(_encode);
}
if (serializedParams) {
const hashmarkIndex = url.indexOf("#");
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
} }
return url; return url;
@@ -1313,7 +1320,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL; return requestedURL;
} }
const VERSION = "1.1.2"; const VERSION = "1.1.3";
/** /**
* A `CanceledError` is an object that is thrown when an operation is canceled. * A `CanceledError` is an object that is thrown when an operation is canceled.
@@ -1451,7 +1458,7 @@ function normalizeValue(value) {
return value; return value;
} }
return String(value); return utils.isArray(value) ? value.map(normalizeValue) : String(value);
} }
function parseTokens(str) { function parseTokens(str) {
@@ -1538,13 +1545,7 @@ Object.assign(AxiosHeaders.prototype, {
return; return;
} }
if (utils.isArray(_value)) { self[key || _header] = normalizeValue(_value);
_value = _value.map(normalizeValue);
} else {
_value = normalizeValue(_value);
}
self[key || _header] = _value;
} }
if (utils.isPlainObject(header)) { if (utils.isPlainObject(header)) {
@@ -1658,13 +1659,13 @@ Object.assign(AxiosHeaders.prototype, {
return this; return this;
}, },
toJSON: function() { toJSON: function(asStrings) {
const obj = Object.create(null); const obj = Object.create(null);
utils.forEach(Object.assign({}, this[$defaults] || null, this), utils.forEach(Object.assign({}, this[$defaults] || null, this),
(value, header) => { (value, header) => {
if (value == null || value === false) return; if (value == null || value === false) return;
obj[header] = utils.isArray(value) ? value.join(', ') : value; obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value;
}); });
return obj; return obj;
@@ -2003,7 +2004,7 @@ function dispatchBeforeRedirect(options) {
* If the proxy or config afterRedirects functions are defined, call them with the options * If the proxy or config afterRedirects functions are defined, call them with the options
* *
* @param {http.ClientRequestArgs} options * @param {http.ClientRequestArgs} options
* @param {AxiosProxyConfig} configProxy * @param {AxiosProxyConfig} configProxy configuration from Axios options object
* @param {string} location * @param {string} location
* *
* @returns {http.ClientRequestArgs} * @returns {http.ClientRequestArgs}
@@ -2034,13 +2035,14 @@ function setProxy(options, configProxy, location) {
} }
options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
options.hostname = proxy.hostname; const proxyHost = proxy.hostname || proxy.host;
options.hostname = proxyHost;
// Replace 'host' since options is not a URL object // Replace 'host' since options is not a URL object
options.host = proxy.hostname; options.host = proxyHost;
options.port = proxy.port; options.port = proxy.port;
options.path = location; options.path = location;
if (proxy.protocol) { if (proxy.protocol) {
options.protocol = proxy.protocol; options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;
} }
} }
@@ -3401,7 +3403,7 @@ class Axios {
config = mergeConfig(this.defaults, config); config = mergeConfig(this.defaults, config);
const transitional = config.transitional; const {transitional, paramsSerializer} = config;
if (transitional !== undefined) { if (transitional !== undefined) {
validator.assertOptions(transitional, { validator.assertOptions(transitional, {
@@ -3411,6 +3413,13 @@ class Axios {
}, false); }, false);
} }
if (paramsSerializer !== undefined) {
validator.assertOptions(paramsSerializer, {
encode: validators.function,
serialize: validators.function
}, true);
}
// Set config.method // Set config.method
config.method = (config.method || this.defaults.method || 'get').toLowerCase(); config.method = (config.method || this.defaults.method || 'get').toLowerCase();
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
export const VERSION = "1.1.2"; export const VERSION = "1.1.3";
+313 -275
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,12 +1,12 @@
{ {
"name": "axios", "name": "axios",
"version": "1.1.2", "version": "1.1.3",
"description": "Promise based HTTP client for the browser and node.js", "description": "Promise based HTTP client for the browser and node.js",
"main": "index.js", "main": "index.js",
"exports": { "exports": {
".": { ".": {
"browser": { "browser": {
"require": "./index.js", "require": "./dist/node/axios.cjs",
"default": "./index.js" "default": "./index.js"
}, },
"default": { "default": {
@@ -131,4 +131,4 @@
"Ben Carp (https://github.com/carpben)", "Ben Carp (https://github.com/carpben)",
"Daniel Lopretto (https://github.com/timemachine3030)" "Daniel Lopretto (https://github.com/timemachine3030)"
] ]
} }