mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
chore(release): v1.5.0 (#5838)
Co-authored-by: DigitalBrainJS <DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1601f4a27a
commit
6365751ba6
@@ -1,5 +1,28 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
# [1.5.0](https://github.com/axios/axios/compare/v1.4.0...v1.5.0) (2023-08-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **adapter:** make adapter loading error more clear by using platform-specific adapters explicitly ([#5837](https://github.com/axios/axios/issues/5837)) ([9a414bb](https://github.com/axios/axios/commit/9a414bb6c81796a95c6c7fe668637825458e8b6d))
|
||||||
|
* **dns:** fixed `cacheable-lookup` integration; ([#5836](https://github.com/axios/axios/issues/5836)) ([b3e327d](https://github.com/axios/axios/commit/b3e327dcc9277bdce34c7ef57beedf644b00d628))
|
||||||
|
* **headers:** added support for setting header names that overlap with class methods; ([#5831](https://github.com/axios/axios/issues/5831)) ([d8b4ca0](https://github.com/axios/axios/commit/d8b4ca0ea5f2f05efa4edfe1e7684593f9f68273))
|
||||||
|
* **headers:** fixed common Content-Type header merging; ([#5832](https://github.com/axios/axios/issues/5832)) ([8fda276](https://github.com/axios/axios/commit/8fda2766b1e6bcb72c3fabc146223083ef13ce17))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* export getAdapter function ([#5324](https://github.com/axios/axios/issues/5324)) ([ca73eb8](https://github.com/axios/axios/commit/ca73eb878df0ae2dace81fe3a7f1fb5986231bf1))
|
||||||
|
* **export:** export adapters without `unsafe` prefix ([#5839](https://github.com/axios/axios/issues/5839)) ([1601f4a](https://github.com/axios/axios/commit/1601f4a27a81ab47fea228f1e244b2c4e3ce28bf))
|
||||||
|
|
||||||
|
### 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 "+66/-29 (#5839 #5837 #5836 #5832 #5831 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/102841186?v=4&s=18" alt="avatar" width="18"/> [夜葬](https://github.com/geekact "+42/-0 (#5324 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/65978976?v=4&s=18" alt="avatar" width="18"/> [Jonathan Budiman](https://github.com/JBudiman00 "+30/-0 (#5788 )")
|
||||||
|
- <img src="https://avatars.githubusercontent.com/u/5492927?v=4&s=18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+3/-5 (#5791 )")
|
||||||
|
|
||||||
# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27)
|
# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "axios",
|
"name": "axios",
|
||||||
"main": "./dist/axios.js",
|
"main": "./dist/axios.js",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"homepage": "https://axios-http.com",
|
"homepage": "https://axios-http.com",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Matt Zabriskie"
|
"Matt Zabriskie"
|
||||||
|
|||||||
Vendored
+26
-18
@@ -1,4 +1,4 @@
|
|||||||
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
// Axios v1.5.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||||
typeof define === 'function' && define.amd ? define(factory) :
|
typeof define === 'function' && define.amd ? define(factory) :
|
||||||
@@ -625,8 +625,9 @@
|
|||||||
var descriptors = Object.getOwnPropertyDescriptors(obj);
|
var descriptors = Object.getOwnPropertyDescriptors(obj);
|
||||||
var reducedDescriptors = {};
|
var reducedDescriptors = {};
|
||||||
forEach(descriptors, function (descriptor, name) {
|
forEach(descriptors, function (descriptor, name) {
|
||||||
if (reducer(descriptor, name, obj) !== false) {
|
var ret;
|
||||||
reducedDescriptors[name] = descriptor;
|
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
||||||
|
reducedDescriptors[name] = ret || descriptor;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Object.defineProperties(obj, reducedDescriptors);
|
Object.defineProperties(obj, reducedDescriptors);
|
||||||
@@ -1361,10 +1362,6 @@
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var DEFAULT_CONTENT_TYPE = {
|
|
||||||
'Content-Type': undefined
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
||||||
* of the input
|
* of the input
|
||||||
@@ -1390,7 +1387,7 @@
|
|||||||
}
|
}
|
||||||
var defaults = {
|
var defaults = {
|
||||||
transitional: transitionalDefaults,
|
transitional: transitionalDefaults,
|
||||||
adapter: ['xhr', 'http'],
|
adapter: platform.isNode ? 'http' : 'xhr',
|
||||||
transformRequest: [function transformRequest(data, headers) {
|
transformRequest: [function transformRequest(data, headers) {
|
||||||
var contentType = headers.getContentType() || '';
|
var contentType = headers.getContentType() || '';
|
||||||
var hasJSONContentType = contentType.indexOf('application/json') > -1;
|
var hasJSONContentType = contentType.indexOf('application/json') > -1;
|
||||||
@@ -1471,16 +1468,14 @@
|
|||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
common: {
|
common: {
|
||||||
'Accept': 'application/json, text/plain, */*'
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Content-Type': undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], function (method) {
|
||||||
defaults.headers[method] = {};
|
defaults.headers[method] = {};
|
||||||
});
|
});
|
||||||
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
||||||
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
||||||
});
|
|
||||||
var defaults$1 = defaults;
|
var defaults$1 = defaults;
|
||||||
|
|
||||||
// RawAxiosHeaders whose duplicates are ignored by node
|
// RawAxiosHeaders whose duplicates are ignored by node
|
||||||
@@ -1781,7 +1776,20 @@
|
|||||||
return AxiosHeaders;
|
return AxiosHeaders;
|
||||||
}(Symbol.iterator, Symbol.toStringTag);
|
}(Symbol.iterator, Symbol.toStringTag);
|
||||||
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
||||||
utils.freezeMethods(AxiosHeaders.prototype);
|
|
||||||
|
// reserved names hotfix
|
||||||
|
utils.reduceDescriptors(AxiosHeaders.prototype, function (_ref3, key) {
|
||||||
|
var value = _ref3.value;
|
||||||
|
var mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
||||||
|
return {
|
||||||
|
get: function get() {
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
set: function set(headerValue) {
|
||||||
|
this[mapped] = headerValue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
utils.freezeMethods(AxiosHeaders);
|
utils.freezeMethods(AxiosHeaders);
|
||||||
var AxiosHeaders$1 = AxiosHeaders;
|
var AxiosHeaders$1 = AxiosHeaders;
|
||||||
|
|
||||||
@@ -2440,7 +2448,7 @@
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
var VERSION = "1.4.0";
|
var VERSION = "1.5.0";
|
||||||
|
|
||||||
var validators$1 = {};
|
var validators$1 = {};
|
||||||
|
|
||||||
@@ -2582,11 +2590,10 @@
|
|||||||
|
|
||||||
// Set config.method
|
// Set config.method
|
||||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||||
var contextHeaders;
|
|
||||||
|
|
||||||
// Flatten headers
|
// Flatten headers
|
||||||
contextHeaders = headers && utils.merge(headers.common, headers[config.method]);
|
var contextHeaders = headers && utils.merge(headers.common, headers[config.method]);
|
||||||
contextHeaders && utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) {
|
headers && utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) {
|
||||||
delete headers[method];
|
delete headers[method];
|
||||||
});
|
});
|
||||||
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
||||||
@@ -2973,6 +2980,7 @@
|
|||||||
axios.formToJSON = function (thing) {
|
axios.formToJSON = function (thing) {
|
||||||
return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
||||||
};
|
};
|
||||||
|
axios.getAdapter = adapters.getAdapter;
|
||||||
axios.HttpStatusCode = HttpStatusCode$1;
|
axios.HttpStatusCode = HttpStatusCode$1;
|
||||||
axios["default"] = axios;
|
axios["default"] = axios;
|
||||||
|
|
||||||
|
|||||||
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
+24
-20
@@ -1,4 +1,4 @@
|
|||||||
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
// Axios v1.5.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function bind(fn, thisArg) {
|
function bind(fn, thisArg) {
|
||||||
@@ -545,8 +545,9 @@ const reduceDescriptors = (obj, reducer) => {
|
|||||||
const reducedDescriptors = {};
|
const reducedDescriptors = {};
|
||||||
|
|
||||||
forEach(descriptors, (descriptor, name) => {
|
forEach(descriptors, (descriptor, name) => {
|
||||||
if (reducer(descriptor, name, obj) !== false) {
|
let ret;
|
||||||
reducedDescriptors[name] = descriptor;
|
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
||||||
|
reducedDescriptors[name] = ret || descriptor;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1388,10 +1389,6 @@ function formDataToJSON(formData) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_CONTENT_TYPE = {
|
|
||||||
'Content-Type': undefined
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
||||||
* of the input
|
* of the input
|
||||||
@@ -1421,7 +1418,7 @@ const defaults = {
|
|||||||
|
|
||||||
transitional: transitionalDefaults,
|
transitional: transitionalDefaults,
|
||||||
|
|
||||||
adapter: ['xhr', 'http'],
|
adapter: platform.isNode ? 'http' : 'xhr',
|
||||||
|
|
||||||
transformRequest: [function transformRequest(data, headers) {
|
transformRequest: [function transformRequest(data, headers) {
|
||||||
const contentType = headers.getContentType() || '';
|
const contentType = headers.getContentType() || '';
|
||||||
@@ -1530,19 +1527,16 @@ const defaults = {
|
|||||||
|
|
||||||
headers: {
|
headers: {
|
||||||
common: {
|
common: {
|
||||||
'Accept': 'application/json, text/plain, */*'
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Content-Type': undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
||||||
defaults.headers[method] = {};
|
defaults.headers[method] = {};
|
||||||
});
|
});
|
||||||
|
|
||||||
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
||||||
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
||||||
});
|
|
||||||
|
|
||||||
var defaults$1 = defaults;
|
var defaults$1 = defaults;
|
||||||
|
|
||||||
// RawAxiosHeaders whose duplicates are ignored by node
|
// RawAxiosHeaders whose duplicates are ignored by node
|
||||||
@@ -1876,7 +1870,17 @@ class AxiosHeaders {
|
|||||||
|
|
||||||
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
||||||
|
|
||||||
utils.freezeMethods(AxiosHeaders.prototype);
|
// reserved names hotfix
|
||||||
|
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
||||||
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
||||||
|
return {
|
||||||
|
get: () => value,
|
||||||
|
set(headerValue) {
|
||||||
|
this[mapped] = headerValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
utils.freezeMethods(AxiosHeaders);
|
utils.freezeMethods(AxiosHeaders);
|
||||||
|
|
||||||
var AxiosHeaders$1 = AxiosHeaders;
|
var AxiosHeaders$1 = AxiosHeaders;
|
||||||
@@ -2631,7 +2635,7 @@ function mergeConfig(config1, config2) {
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VERSION = "1.4.0";
|
const VERSION = "1.5.0";
|
||||||
|
|
||||||
const validators$1 = {};
|
const validators$1 = {};
|
||||||
|
|
||||||
@@ -2784,15 +2788,13 @@ class Axios {
|
|||||||
// Set config.method
|
// Set config.method
|
||||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||||
|
|
||||||
let contextHeaders;
|
|
||||||
|
|
||||||
// Flatten headers
|
// Flatten headers
|
||||||
contextHeaders = headers && utils.merge(
|
let contextHeaders = headers && utils.merge(
|
||||||
headers.common,
|
headers.common,
|
||||||
headers[config.method]
|
headers[config.method]
|
||||||
);
|
);
|
||||||
|
|
||||||
contextHeaders && utils.forEach(
|
headers && utils.forEach(
|
||||||
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
||||||
(method) => {
|
(method) => {
|
||||||
delete headers[method];
|
delete headers[method];
|
||||||
@@ -3202,6 +3204,8 @@ axios.AxiosHeaders = AxiosHeaders$1;
|
|||||||
|
|
||||||
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
||||||
|
|
||||||
|
axios.getAdapter = adapters.getAdapter;
|
||||||
|
|
||||||
axios.HttpStatusCode = HttpStatusCode$1;
|
axios.HttpStatusCode = HttpStatusCode$1;
|
||||||
|
|
||||||
axios.default = axios;
|
axios.default = axios;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+26
-21
@@ -1,4 +1,4 @@
|
|||||||
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
// Axios v1.5.0 Copyright (c) 2023 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);
|
||||||
@@ -543,8 +543,9 @@ const reduceDescriptors = (obj, reducer) => {
|
|||||||
const reducedDescriptors = {};
|
const reducedDescriptors = {};
|
||||||
|
|
||||||
forEach(descriptors, (descriptor, name) => {
|
forEach(descriptors, (descriptor, name) => {
|
||||||
if (reducer(descriptor, name, obj) !== false) {
|
let ret;
|
||||||
reducedDescriptors[name] = descriptor;
|
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
||||||
|
reducedDescriptors[name] = ret || descriptor;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1386,10 +1387,6 @@ function formDataToJSON(formData) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_CONTENT_TYPE = {
|
|
||||||
'Content-Type': undefined
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
||||||
* of the input
|
* of the input
|
||||||
@@ -1419,7 +1416,7 @@ const defaults = {
|
|||||||
|
|
||||||
transitional: transitionalDefaults,
|
transitional: transitionalDefaults,
|
||||||
|
|
||||||
adapter: ['xhr', 'http'],
|
adapter: platform.isNode ? 'http' : 'xhr',
|
||||||
|
|
||||||
transformRequest: [function transformRequest(data, headers) {
|
transformRequest: [function transformRequest(data, headers) {
|
||||||
const contentType = headers.getContentType() || '';
|
const contentType = headers.getContentType() || '';
|
||||||
@@ -1528,19 +1525,16 @@ const defaults = {
|
|||||||
|
|
||||||
headers: {
|
headers: {
|
||||||
common: {
|
common: {
|
||||||
'Accept': 'application/json, text/plain, */*'
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Content-Type': undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
||||||
defaults.headers[method] = {};
|
defaults.headers[method] = {};
|
||||||
});
|
});
|
||||||
|
|
||||||
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
||||||
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
||||||
});
|
|
||||||
|
|
||||||
const defaults$1 = defaults;
|
const defaults$1 = defaults;
|
||||||
|
|
||||||
// RawAxiosHeaders whose duplicates are ignored by node
|
// RawAxiosHeaders whose duplicates are ignored by node
|
||||||
@@ -1874,7 +1868,17 @@ class AxiosHeaders$1 {
|
|||||||
|
|
||||||
AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
||||||
|
|
||||||
utils.freezeMethods(AxiosHeaders$1.prototype);
|
// reserved names hotfix
|
||||||
|
utils.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
|
||||||
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
||||||
|
return {
|
||||||
|
get: () => value,
|
||||||
|
set(headerValue) {
|
||||||
|
this[mapped] = headerValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
utils.freezeMethods(AxiosHeaders$1);
|
utils.freezeMethods(AxiosHeaders$1);
|
||||||
|
|
||||||
const AxiosHeaders$2 = AxiosHeaders$1;
|
const AxiosHeaders$2 = AxiosHeaders$1;
|
||||||
@@ -2629,7 +2633,7 @@ function mergeConfig$1(config1, config2) {
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VERSION$1 = "1.4.0";
|
const VERSION$1 = "1.5.0";
|
||||||
|
|
||||||
const validators$1 = {};
|
const validators$1 = {};
|
||||||
|
|
||||||
@@ -2782,15 +2786,13 @@ class Axios$1 {
|
|||||||
// Set config.method
|
// Set config.method
|
||||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||||
|
|
||||||
let contextHeaders;
|
|
||||||
|
|
||||||
// Flatten headers
|
// Flatten headers
|
||||||
contextHeaders = headers && utils.merge(
|
let contextHeaders = headers && utils.merge(
|
||||||
headers.common,
|
headers.common,
|
||||||
headers[config.method]
|
headers[config.method]
|
||||||
);
|
);
|
||||||
|
|
||||||
contextHeaders && utils.forEach(
|
headers && utils.forEach(
|
||||||
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
||||||
(method) => {
|
(method) => {
|
||||||
delete headers[method];
|
delete headers[method];
|
||||||
@@ -3200,6 +3202,8 @@ axios.AxiosHeaders = AxiosHeaders$2;
|
|||||||
|
|
||||||
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
||||||
|
|
||||||
|
axios.getAdapter = adapters.getAdapter;
|
||||||
|
|
||||||
axios.HttpStatusCode = HttpStatusCode$2;
|
axios.HttpStatusCode = HttpStatusCode$2;
|
||||||
|
|
||||||
axios.default = axios;
|
axios.default = axios;
|
||||||
@@ -3225,8 +3229,9 @@ const {
|
|||||||
AxiosHeaders,
|
AxiosHeaders,
|
||||||
HttpStatusCode,
|
HttpStatusCode,
|
||||||
formToJSON,
|
formToJSON,
|
||||||
|
getAdapter,
|
||||||
mergeConfig
|
mergeConfig
|
||||||
} = axios$1;
|
} = axios$1;
|
||||||
|
|
||||||
export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios$1 as default, formToJSON, isAxiosError, isCancel, mergeConfig, spread, toFormData };
|
export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios$1 as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
|
||||||
//# sourceMappingURL=axios.js.map
|
//# sourceMappingURL=axios.js.map
|
||||||
|
|||||||
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
+27
-21
@@ -1,4 +1,4 @@
|
|||||||
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
// Axios v1.5.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const FormData$1 = require('form-data');
|
const FormData$1 = require('form-data');
|
||||||
@@ -568,8 +568,9 @@ const reduceDescriptors = (obj, reducer) => {
|
|||||||
const reducedDescriptors = {};
|
const reducedDescriptors = {};
|
||||||
|
|
||||||
forEach(descriptors, (descriptor, name) => {
|
forEach(descriptors, (descriptor, name) => {
|
||||||
if (reducer(descriptor, name, obj) !== false) {
|
let ret;
|
||||||
reducedDescriptors[name] = descriptor;
|
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
||||||
|
reducedDescriptors[name] = ret || descriptor;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1353,10 +1354,6 @@ function formDataToJSON(formData) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_CONTENT_TYPE = {
|
|
||||||
'Content-Type': undefined
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
||||||
* of the input
|
* of the input
|
||||||
@@ -1386,7 +1383,7 @@ const defaults = {
|
|||||||
|
|
||||||
transitional: transitionalDefaults,
|
transitional: transitionalDefaults,
|
||||||
|
|
||||||
adapter: ['xhr', 'http'],
|
adapter: 'http' ,
|
||||||
|
|
||||||
transformRequest: [function transformRequest(data, headers) {
|
transformRequest: [function transformRequest(data, headers) {
|
||||||
const contentType = headers.getContentType() || '';
|
const contentType = headers.getContentType() || '';
|
||||||
@@ -1495,19 +1492,16 @@ const defaults = {
|
|||||||
|
|
||||||
headers: {
|
headers: {
|
||||||
common: {
|
common: {
|
||||||
'Accept': 'application/json, text/plain, */*'
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Content-Type': undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
||||||
defaults.headers[method] = {};
|
defaults.headers[method] = {};
|
||||||
});
|
});
|
||||||
|
|
||||||
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
||||||
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
||||||
});
|
|
||||||
|
|
||||||
const defaults$1 = defaults;
|
const defaults$1 = defaults;
|
||||||
|
|
||||||
// RawAxiosHeaders whose duplicates are ignored by node
|
// RawAxiosHeaders whose duplicates are ignored by node
|
||||||
@@ -1841,7 +1835,17 @@ class AxiosHeaders {
|
|||||||
|
|
||||||
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
||||||
|
|
||||||
utils.freezeMethods(AxiosHeaders.prototype);
|
// reserved names hotfix
|
||||||
|
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
||||||
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
||||||
|
return {
|
||||||
|
get: () => value,
|
||||||
|
set(headerValue) {
|
||||||
|
this[mapped] = headerValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
utils.freezeMethods(AxiosHeaders);
|
utils.freezeMethods(AxiosHeaders);
|
||||||
|
|
||||||
const AxiosHeaders$1 = AxiosHeaders;
|
const AxiosHeaders$1 = AxiosHeaders;
|
||||||
@@ -1961,7 +1965,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|||||||
return requestedURL;
|
return requestedURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VERSION = "1.4.0";
|
const VERSION = "1.5.0";
|
||||||
|
|
||||||
function parseProtocol(url) {
|
function parseProtocol(url) {
|
||||||
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
||||||
@@ -2810,11 +2814,13 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|||||||
auth,
|
auth,
|
||||||
protocol,
|
protocol,
|
||||||
family,
|
family,
|
||||||
lookup,
|
|
||||||
beforeRedirect: dispatchBeforeRedirect,
|
beforeRedirect: dispatchBeforeRedirect,
|
||||||
beforeRedirects: {}
|
beforeRedirects: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// cacheable-lookup integration hotfix
|
||||||
|
!utils.isUndefined(lookup) && (options.lookup = lookup);
|
||||||
|
|
||||||
if (config.socketPath) {
|
if (config.socketPath) {
|
||||||
options.socketPath = config.socketPath;
|
options.socketPath = config.socketPath;
|
||||||
} else {
|
} else {
|
||||||
@@ -3811,15 +3817,13 @@ class Axios {
|
|||||||
// Set config.method
|
// Set config.method
|
||||||
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
||||||
|
|
||||||
let contextHeaders;
|
|
||||||
|
|
||||||
// Flatten headers
|
// Flatten headers
|
||||||
contextHeaders = headers && utils.merge(
|
let contextHeaders = headers && utils.merge(
|
||||||
headers.common,
|
headers.common,
|
||||||
headers[config.method]
|
headers[config.method]
|
||||||
);
|
);
|
||||||
|
|
||||||
contextHeaders && utils.forEach(
|
headers && utils.forEach(
|
||||||
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
||||||
(method) => {
|
(method) => {
|
||||||
delete headers[method];
|
delete headers[method];
|
||||||
@@ -4229,6 +4233,8 @@ axios.AxiosHeaders = AxiosHeaders$1;
|
|||||||
|
|
||||||
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
||||||
|
|
||||||
|
axios.getAdapter = adapters.getAdapter;
|
||||||
|
|
||||||
axios.HttpStatusCode = HttpStatusCode$1;
|
axios.HttpStatusCode = HttpStatusCode$1;
|
||||||
|
|
||||||
axios.default = axios;
|
axios.default = axios;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
export const VERSION = "1.4.0";
|
export const VERSION = "1.5.0";
|
||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "axios",
|
"name": "axios",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "axios",
|
"name": "axios",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.15.0",
|
"follow-redirects": "^1.15.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "axios",
|
"name": "axios",
|
||||||
"version": "1.4.0",
|
"version": "1.5.0",
|
||||||
"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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user