axios 1.3.5 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of axios might be problematic. Click here for more details.
- package/CHANGELOG.md +38 -0
- package/dist/axios.js +20 -8
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +26 -11
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +26 -11
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +55 -12
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +22 -18
- package/index.d.ts +6 -2
- package/lib/adapters/http.js +15 -1
- package/lib/adapters/xhr.js +6 -2
- package/lib/core/mergeConfig.js +1 -1
- package/lib/env/data.js +1 -1
- package/lib/helpers/callbackify.js +16 -0
- package/lib/utils.js +17 -6
- package/package.json +13 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,43 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* **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))
|
9
|
+
* **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09))
|
10
|
+
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
* **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb))
|
15
|
+
* **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf))
|
16
|
+
|
17
|
+
|
18
|
+
### Performance Improvements
|
19
|
+
|
20
|
+
* **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))
|
21
|
+
|
22
|
+
### Contributors to this release
|
23
|
+
|
24
|
+
- <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 )")
|
25
|
+
- <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 )")
|
26
|
+
- <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 )")
|
27
|
+
|
28
|
+
## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19)
|
29
|
+
|
30
|
+
|
31
|
+
### Bug Fixes
|
32
|
+
|
33
|
+
* **types:** added transport to RawAxiosRequestConfig ([#5445](https://github.com/axios/axios/issues/5445)) ([6f360a2](https://github.com/axios/axios/commit/6f360a2531d8d70363fd9becef6a45a323f170e2))
|
34
|
+
* **utils:** make isFormData detection logic stricter to avoid unnecessary calling of the `toString` method on the target; ([#5661](https://github.com/axios/axios/issues/5661)) ([aa372f7](https://github.com/axios/axios/commit/aa372f7306295dfd1100c1c2c77ce95c95808e76))
|
35
|
+
|
36
|
+
### Contributors to this release
|
37
|
+
|
38
|
+
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+48/-10 (#5665 #5661 #5663 )")
|
39
|
+
- <img src="https://avatars.githubusercontent.com/u/5492927?v=4&s=18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+2/-0 (#5445 )")
|
40
|
+
|
3
41
|
## [1.3.5](https://github.com/axios/axios/compare/v1.3.4...v1.3.5) (2023-04-05)
|
4
42
|
|
5
43
|
|
package/dist/axios.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.
|
1
|
+
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
|
2
2
|
(function (global, factory) {
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
@@ -283,8 +283,10 @@
|
|
283
283
|
* @returns {boolean} True if value is an FormData, otherwise false
|
284
284
|
*/
|
285
285
|
var isFormData = function isFormData(thing) {
|
286
|
-
var
|
287
|
-
return thing && (typeof FormData === 'function' && thing instanceof FormData ||
|
286
|
+
var kind;
|
287
|
+
return thing && (typeof FormData === 'function' && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === 'formdata' ||
|
288
|
+
// detect form-data instance
|
289
|
+
kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]'));
|
288
290
|
};
|
289
291
|
|
290
292
|
/**
|
@@ -720,6 +722,10 @@
|
|
720
722
|
};
|
721
723
|
return visit(obj, 0);
|
722
724
|
};
|
725
|
+
var isAsyncFn = kindOfTest('AsyncFunction');
|
726
|
+
var isThenable = function isThenable(thing) {
|
727
|
+
return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing["catch"]);
|
728
|
+
};
|
723
729
|
var utils = {
|
724
730
|
isArray: isArray,
|
725
731
|
isArrayBuffer: isArrayBuffer,
|
@@ -770,7 +776,9 @@
|
|
770
776
|
ALPHABET: ALPHABET,
|
771
777
|
generateString: generateString,
|
772
778
|
isSpecCompliantForm: isSpecCompliantForm,
|
773
|
-
toJSONObject: toJSONObject
|
779
|
+
toJSONObject: toJSONObject,
|
780
|
+
isAsyncFn: isAsyncFn,
|
781
|
+
isThenable: isThenable
|
774
782
|
};
|
775
783
|
|
776
784
|
/**
|
@@ -2059,8 +2067,12 @@
|
|
2059
2067
|
config.signal.removeEventListener('abort', onCanceled);
|
2060
2068
|
}
|
2061
2069
|
}
|
2062
|
-
if (utils.isFormData(requestData)
|
2063
|
-
|
2070
|
+
if (utils.isFormData(requestData)) {
|
2071
|
+
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
|
2072
|
+
requestHeaders.setContentType(false); // Let the browser set it
|
2073
|
+
} else {
|
2074
|
+
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
|
2075
|
+
}
|
2064
2076
|
}
|
2065
2077
|
|
2066
2078
|
var request = new XMLHttpRequest();
|
@@ -2420,7 +2432,7 @@
|
|
2420
2432
|
return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
|
2421
2433
|
}
|
2422
2434
|
};
|
2423
|
-
utils.forEach(Object.keys(
|
2435
|
+
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2424
2436
|
var merge = mergeMap[prop] || mergeDeepProperties;
|
2425
2437
|
var configValue = merge(config1[prop], config2[prop], prop);
|
2426
2438
|
utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
@@ -2428,7 +2440,7 @@
|
|
2428
2440
|
return config;
|
2429
2441
|
}
|
2430
2442
|
|
2431
|
-
var VERSION = "1.
|
2443
|
+
var VERSION = "1.4.0";
|
2432
2444
|
|
2433
2445
|
var validators$1 = {};
|
2434
2446
|
|