@ohif/app 3.13.0-beta.134 → 3.13.0-beta.135
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.
- package/dist/{12.bundle.b056ab4f14043f8f.js → 12.bundle.b4688cdbdd856b75.js} +428 -118
- package/dist/{136.bundle.21c8f91a8a65d7a6.js → 136.bundle.b948da0438a0a660.js} +1 -1
- package/dist/{2299.bundle.a959a7343d38aa72.js → 2299.bundle.2375af8b16a1702e.js} +1 -1
- package/dist/{2493.bundle.356acd635467d881.js → 2493.bundle.c4af70e46357151f.js} +1910 -1939
- package/dist/{89.bundle.7155919d00b05c62.js → 89.bundle.f6ee21920d04f9ae.js} +2 -2
- package/dist/{app.bundle.e0e3a23e105055f3.js → app.bundle.310d7cd9caf89f9d.js} +1920 -1949
- package/dist/{compute.bundle.cb283bdafa93bbba.js → compute.bundle.0fc3a3ee85296cf2.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/{interpolation.bundle.bcf66f3692d530c1.js → interpolation.bundle.fa54018d8628f8c0.js} +1 -1
- package/dist/{polySeg.bundle.09e8522c5bafa9a9.js → polySeg.bundle.2c5892e4c5a6bdd5.js} +1 -1
- package/dist/sw.js +1 -1
- package/package.json +5 -5
- /package/dist/{100.bundle.e78c1a01fba35358.js → 100.bundle.e6d03fdfc66d9429.js} +0 -0
- /package/dist/{1180.bundle.117cd42ce109befd.js → 1180.bundle.c15f11f74168c0be.js} +0 -0
- /package/dist/{1483.bundle.0db20796c1d18405.js → 1483.bundle.2421435d03a3c061.js} +0 -0
- /package/dist/{1602.bundle.bd1b12aa94911291.js → 1602.bundle.2139e99971b6f3fe.js} +0 -0
- /package/dist/{2779.bundle.24524ad7be1a19bd.js → 2779.bundle.849a43678f8fa214.js} +0 -0
- /package/dist/{3500.bundle.117f07cb75ea8611.js → 3500.bundle.4986063116eff360.js} +0 -0
- /package/dist/{3760.bundle.ee6212c13063c907.js → 3760.bundle.e2f268d51059d5b3.js} +0 -0
- /package/dist/{4556.bundle.dd9f6471bbeff779.js → 4556.bundle.0998337bec42392a.js} +0 -0
- /package/dist/{4683.bundle.1f4ffcb38c5284cf.js → 4683.bundle.95f708a099dc61b0.js} +0 -0
- /package/dist/{5696.bundle.5522f406d0efb1df.js → 5696.bundle.5825b63e5a1c10d5.js} +0 -0
- /package/dist/{6749.bundle.ae4135f5eb464ab4.js → 6749.bundle.1c93fccf235236c9.js} +0 -0
- /package/dist/{7248.bundle.6903fdfbb870a107.js → 7248.bundle.a979c316cf0107ed.js} +0 -0
- /package/dist/{7499.bundle.f1f230abf73812e5.js → 7499.bundle.43e0dae1c86e35e7.js} +0 -0
- /package/dist/{781.bundle.9e551c660552b61e.js → 781.bundle.f72c2152ccaf2d3b.js} +0 -0
- /package/dist/{8423.bundle.e5d9266124a23908.js → 8423.bundle.cdfbd978226fa393.js} +0 -0
- /package/dist/{8492.bundle.43e9236e51089d79.js → 8492.bundle.864d16c23662e055.js} +0 -0
- /package/dist/{8832.bundle.8aa7d7587bdb8742.js → 8832.bundle.ed8d55524d81043b.js} +0 -0
- /package/dist/{9116.bundle.4d482f127d6d30b1.js → 9116.bundle.bcd94324a3b4b9bd.js} +0 -0
- /package/dist/{9290.bundle.ffb97d5efea39049.js → 9290.bundle.ae1143f9e1364ff9.js} +0 -0
- /package/dist/{9415.bundle.92690aba457357a5.js → 9415.bundle.382e78ac5c826f79.js} +0 -0
- /package/dist/{9437.bundle.7edd04c2c3c80360.js → 9437.bundle.54532660f274b78b.js} +0 -0
|
@@ -46,6 +46,57 @@ const { toString: utils_toString } = Object.prototype;
|
|
|
46
46
|
const { getPrototypeOf } = Object;
|
|
47
47
|
const { iterator: utils_iterator, toStringTag } = Symbol;
|
|
48
48
|
|
|
49
|
+
/* Creating a function that will check if an object has a property. */
|
|
50
|
+
const utils_hasOwnProperty = (
|
|
51
|
+
({ hasOwnProperty }) =>
|
|
52
|
+
(obj, prop) =>
|
|
53
|
+
hasOwnProperty.call(obj, prop)
|
|
54
|
+
)(Object.prototype);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Walk the prototype chain (excluding the shared Object.prototype) looking for
|
|
58
|
+
* an own `prop`. This distinguishes genuine own/inherited members — including
|
|
59
|
+
* class accessors and template prototypes — from members injected via
|
|
60
|
+
* Object.prototype pollution (e.g. `Object.prototype.username = '...'`), which
|
|
61
|
+
* live on Object.prototype itself and are therefore never matched.
|
|
62
|
+
*
|
|
63
|
+
* @param {*} thing The value whose chain to inspect
|
|
64
|
+
* @param {string|symbol} prop The property key to look for
|
|
65
|
+
*
|
|
66
|
+
* @returns {boolean} True when `prop` is owned below Object.prototype
|
|
67
|
+
*/
|
|
68
|
+
const hasOwnInPrototypeChain = (thing, prop) => {
|
|
69
|
+
let obj = thing;
|
|
70
|
+
const seen = [];
|
|
71
|
+
|
|
72
|
+
while (obj != null && obj !== Object.prototype) {
|
|
73
|
+
if (seen.indexOf(obj) !== -1) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
seen.push(obj);
|
|
77
|
+
|
|
78
|
+
if (utils_hasOwnProperty(obj, prop)) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
obj = getPrototypeOf(obj);
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Read `obj[prop]` only when it is safe from Object.prototype pollution. Own
|
|
88
|
+
* properties and members inherited from a non-Object.prototype source (a class
|
|
89
|
+
* instance or template object) are honored; a value reachable only through a
|
|
90
|
+
* polluted Object.prototype is ignored and `undefined` is returned.
|
|
91
|
+
*
|
|
92
|
+
* @param {*} obj The source object
|
|
93
|
+
* @param {string|symbol} prop The property key to read
|
|
94
|
+
*
|
|
95
|
+
* @returns {*} The resolved value, or undefined when unsafe/absent
|
|
96
|
+
*/
|
|
97
|
+
const getSafeProp = (obj, prop) =>
|
|
98
|
+
obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
|
|
99
|
+
|
|
49
100
|
const kindOf = ((cache) => (thing) => {
|
|
50
101
|
const str = utils_toString.call(thing);
|
|
51
102
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -171,7 +222,7 @@ const isBoolean = (thing) => thing === true || thing === false;
|
|
|
171
222
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
172
223
|
*/
|
|
173
224
|
const isPlainObject = (val) => {
|
|
174
|
-
if (
|
|
225
|
+
if (!isObject(val)) {
|
|
175
226
|
return false;
|
|
176
227
|
}
|
|
177
228
|
|
|
@@ -179,9 +230,12 @@ const isPlainObject = (val) => {
|
|
|
179
230
|
return (
|
|
180
231
|
(prototype === null ||
|
|
181
232
|
prototype === Object.prototype ||
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
233
|
+
getPrototypeOf(prototype) === null) &&
|
|
234
|
+
// Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
|
|
235
|
+
// Symbol.iterator as evidence the value is a tagged/iterable type rather
|
|
236
|
+
// than a plain object, while ignoring keys injected onto Object.prototype.
|
|
237
|
+
!hasOwnInPrototypeChain(val, toStringTag) &&
|
|
238
|
+
!hasOwnInPrototypeChain(val, utils_iterator)
|
|
185
239
|
);
|
|
186
240
|
};
|
|
187
241
|
|
|
@@ -708,13 +762,6 @@ const toCamelCase = (str) => {
|
|
|
708
762
|
});
|
|
709
763
|
};
|
|
710
764
|
|
|
711
|
-
/* Creating a function that will check if an object has a property. */
|
|
712
|
-
const utils_hasOwnProperty = (
|
|
713
|
-
({ hasOwnProperty }) =>
|
|
714
|
-
(obj, prop) =>
|
|
715
|
-
hasOwnProperty.call(obj, prop)
|
|
716
|
-
)(Object.prototype);
|
|
717
|
-
|
|
718
765
|
const { propertyIsEnumerable } = Object.prototype;
|
|
719
766
|
|
|
720
767
|
/**
|
|
@@ -928,6 +975,20 @@ const asap =
|
|
|
928
975
|
|
|
929
976
|
const isIterable = (thing) => thing != null && isFunction(thing[utils_iterator]);
|
|
930
977
|
|
|
978
|
+
/**
|
|
979
|
+
* Determine if a value is iterable via an iterator that is NOT sourced solely
|
|
980
|
+
* from a polluted Object.prototype. Use this instead of `isIterable` whenever
|
|
981
|
+
* the iterable comes from untrusted input (e.g. user-supplied header sources),
|
|
982
|
+
* so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object
|
|
983
|
+
* into an attacker-controlled entries iterator.
|
|
984
|
+
*
|
|
985
|
+
* @param {*} thing The value to test
|
|
986
|
+
*
|
|
987
|
+
* @returns {boolean} True if value has a non-polluted iterator
|
|
988
|
+
*/
|
|
989
|
+
const isSafeIterable = (thing) =>
|
|
990
|
+
thing != null && hasOwnInPrototypeChain(thing, utils_iterator) && isIterable(thing);
|
|
991
|
+
|
|
931
992
|
/* export default */ const utils = ({
|
|
932
993
|
isArray,
|
|
933
994
|
isArrayBuffer,
|
|
@@ -972,6 +1033,8 @@ const isIterable = (thing) => thing != null && isFunction(thing[utils_iterator])
|
|
|
972
1033
|
isHTMLForm,
|
|
973
1034
|
hasOwnProperty: utils_hasOwnProperty,
|
|
974
1035
|
hasOwnProp: utils_hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
|
|
1036
|
+
hasOwnInPrototypeChain,
|
|
1037
|
+
getSafeProp,
|
|
975
1038
|
reduceDescriptors,
|
|
976
1039
|
freezeMethods,
|
|
977
1040
|
toObjectSet,
|
|
@@ -988,6 +1051,7 @@ const isIterable = (thing) => thing != null && isFunction(thing[utils_iterator])
|
|
|
988
1051
|
setImmediate: _setImmediate,
|
|
989
1052
|
asap,
|
|
990
1053
|
isIterable,
|
|
1054
|
+
isSafeIterable,
|
|
991
1055
|
});
|
|
992
1056
|
|
|
993
1057
|
;// CONCATENATED MODULE: ../../../node_modules/axios/lib/helpers/parseHeaders.js
|
|
@@ -1237,8 +1301,8 @@ class AxiosHeaders {
|
|
|
1237
1301
|
setHeaders(header, valueOrRewrite);
|
|
1238
1302
|
} else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1239
1303
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1240
|
-
} else if (utils.isObject(header) && utils.
|
|
1241
|
-
let obj =
|
|
1304
|
+
} else if (utils.isObject(header) && utils.isSafeIterable(header)) {
|
|
1305
|
+
let obj = Object.create(null),
|
|
1242
1306
|
dest,
|
|
1243
1307
|
key;
|
|
1244
1308
|
for (const entry of header) {
|
|
@@ -1246,11 +1310,14 @@ class AxiosHeaders {
|
|
|
1246
1310
|
throw new TypeError('Object iterator must return a key-value pair');
|
|
1247
1311
|
}
|
|
1248
1312
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
: entry[1];
|
|
1313
|
+
key = entry[0];
|
|
1314
|
+
|
|
1315
|
+
if (utils.hasOwnProp(obj, key)) {
|
|
1316
|
+
dest = obj[key];
|
|
1317
|
+
obj[key] = utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
|
|
1318
|
+
} else {
|
|
1319
|
+
obj[key] = entry[1];
|
|
1320
|
+
}
|
|
1254
1321
|
}
|
|
1255
1322
|
|
|
1256
1323
|
setHeaders(obj, valueOrRewrite);
|
|
@@ -1551,7 +1618,19 @@ function redactConfig(config, redactKeys) {
|
|
|
1551
1618
|
class AxiosError extends Error {
|
|
1552
1619
|
static from(error, code, config, request, response, customProps) {
|
|
1553
1620
|
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
1554
|
-
|
|
1621
|
+
// Match native `Error` `cause` semantics: non-enumerable. The wrapped
|
|
1622
|
+
// error often carries circular internals (sockets, requests, agents), so
|
|
1623
|
+
// an enumerable `cause` makes structured loggers (pino/winston) and any
|
|
1624
|
+
// own-property walk throw "Converting circular structure to JSON".
|
|
1625
|
+
// Regression from #6982; see #7205. `__proto__: null` mirrors the
|
|
1626
|
+
// `message` descriptor below (prototype-pollution-safe descriptor).
|
|
1627
|
+
Object.defineProperty(axiosError, 'cause', {
|
|
1628
|
+
__proto__: null,
|
|
1629
|
+
value: error,
|
|
1630
|
+
writable: true,
|
|
1631
|
+
enumerable: false,
|
|
1632
|
+
configurable: true,
|
|
1633
|
+
});
|
|
1555
1634
|
axiosError.name = error.name;
|
|
1556
1635
|
|
|
1557
1636
|
// Preserve status from the original error if not already set from response
|
|
@@ -1664,6 +1743,10 @@ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
|
1664
1743
|
// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored
|
|
1665
1744
|
|
|
1666
1745
|
|
|
1746
|
+
// Default nesting limit shared with the inverse transform (formDataToJSON) so
|
|
1747
|
+
// the FormData <-> JSON round-trip stays symmetric.
|
|
1748
|
+
const DEFAULT_FORM_DATA_MAX_DEPTH = 100;
|
|
1749
|
+
|
|
1667
1750
|
/**
|
|
1668
1751
|
* Determines if the given thing is a array or js object.
|
|
1669
1752
|
*
|
|
@@ -1774,8 +1857,9 @@ function toFormData(obj, formData, options) {
|
|
|
1774
1857
|
const dots = options.dots;
|
|
1775
1858
|
const indexes = options.indexes;
|
|
1776
1859
|
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
1777
|
-
const maxDepth = options.maxDepth === undefined ?
|
|
1860
|
+
const maxDepth = options.maxDepth === undefined ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
|
|
1778
1861
|
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
|
1862
|
+
const stack = [];
|
|
1779
1863
|
|
|
1780
1864
|
if (!utils.isFunction(visitor)) {
|
|
1781
1865
|
throw new TypeError('visitor must be a function');
|
|
@@ -1797,12 +1881,50 @@ function toFormData(obj, formData, options) {
|
|
|
1797
1881
|
}
|
|
1798
1882
|
|
|
1799
1883
|
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
1800
|
-
|
|
1884
|
+
if (useBlob && typeof _Blob === 'function') {
|
|
1885
|
+
return new _Blob([value]);
|
|
1886
|
+
}
|
|
1887
|
+
if (typeof Buffer !== 'undefined') {
|
|
1888
|
+
return Buffer.from(value);
|
|
1889
|
+
}
|
|
1890
|
+
throw new core_AxiosError('Blob is not supported. Use a Buffer instead.', core_AxiosError.ERR_NOT_SUPPORT);
|
|
1801
1891
|
}
|
|
1802
1892
|
|
|
1803
1893
|
return value;
|
|
1804
1894
|
}
|
|
1805
1895
|
|
|
1896
|
+
function throwIfMaxDepthExceeded(depth) {
|
|
1897
|
+
if (depth > maxDepth) {
|
|
1898
|
+
throw new core_AxiosError(
|
|
1899
|
+
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
1900
|
+
core_AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
1901
|
+
);
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
function stringifyWithDepthLimit(value, depth) {
|
|
1906
|
+
if (maxDepth === Infinity) {
|
|
1907
|
+
return JSON.stringify(value);
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
const ancestors = [];
|
|
1911
|
+
|
|
1912
|
+
return JSON.stringify(value, function limitDepth(_key, currentValue) {
|
|
1913
|
+
if (!utils.isObject(currentValue)) {
|
|
1914
|
+
return currentValue;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
|
|
1918
|
+
ancestors.pop();
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
ancestors.push(currentValue);
|
|
1922
|
+
throwIfMaxDepthExceeded(depth + ancestors.length - 1);
|
|
1923
|
+
|
|
1924
|
+
return currentValue;
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1806
1928
|
/**
|
|
1807
1929
|
* Default visitor.
|
|
1808
1930
|
*
|
|
@@ -1826,7 +1948,7 @@ function toFormData(obj, formData, options) {
|
|
|
1826
1948
|
// eslint-disable-next-line no-param-reassign
|
|
1827
1949
|
key = metaTokens ? key : key.slice(0, -2);
|
|
1828
1950
|
// eslint-disable-next-line no-param-reassign
|
|
1829
|
-
value =
|
|
1951
|
+
value = stringifyWithDepthLimit(value, 1);
|
|
1830
1952
|
} else if (
|
|
1831
1953
|
(utils.isArray(value) && isFlatArray(value)) ||
|
|
1832
1954
|
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)))
|
|
@@ -1859,8 +1981,6 @@ function toFormData(obj, formData, options) {
|
|
|
1859
1981
|
return false;
|
|
1860
1982
|
}
|
|
1861
1983
|
|
|
1862
|
-
const stack = [];
|
|
1863
|
-
|
|
1864
1984
|
const exposedHelpers = Object.assign(predicates, {
|
|
1865
1985
|
defaultVisitor,
|
|
1866
1986
|
convertValue,
|
|
@@ -1870,12 +1990,7 @@ function toFormData(obj, formData, options) {
|
|
|
1870
1990
|
function build(value, path, depth = 0) {
|
|
1871
1991
|
if (utils.isUndefined(value)) return;
|
|
1872
1992
|
|
|
1873
|
-
|
|
1874
|
-
throw new core_AxiosError(
|
|
1875
|
-
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
1876
|
-
core_AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
1877
|
-
);
|
|
1878
|
-
}
|
|
1993
|
+
throwIfMaxDepthExceeded(depth);
|
|
1879
1994
|
|
|
1880
1995
|
if (stack.indexOf(value) !== -1) {
|
|
1881
1996
|
throw new Error('Circular reference detected in ' + path.join('.'));
|
|
@@ -1956,9 +2071,7 @@ AxiosURLSearchParams_prototype.append = function append(name, value) {
|
|
|
1956
2071
|
|
|
1957
2072
|
AxiosURLSearchParams_prototype.toString = function toString(encoder) {
|
|
1958
2073
|
const _encode = encoder
|
|
1959
|
-
?
|
|
1960
|
-
return encoder.call(this, value, encode);
|
|
1961
|
-
}
|
|
2074
|
+
? (value) => encoder.call(this, value, encode)
|
|
1962
2075
|
: encode;
|
|
1963
2076
|
|
|
1964
2077
|
return this._pairs
|
|
@@ -2005,8 +2118,7 @@ function buildURL(url, params, options) {
|
|
|
2005
2118
|
if (!params) {
|
|
2006
2119
|
return url;
|
|
2007
2120
|
}
|
|
2008
|
-
|
|
2009
|
-
const _encode = (options && options.encode) || buildURL_encode;
|
|
2121
|
+
url = url || '';
|
|
2010
2122
|
|
|
2011
2123
|
const _options = utils.isFunction(options)
|
|
2012
2124
|
? {
|
|
@@ -2014,7 +2126,11 @@ function buildURL(url, params, options) {
|
|
|
2014
2126
|
}
|
|
2015
2127
|
: options;
|
|
2016
2128
|
|
|
2017
|
-
|
|
2129
|
+
// Read serializer options pollution-safely: own properties and methods on a
|
|
2130
|
+
// class/template prototype are honored, but values injected onto a polluted
|
|
2131
|
+
// Object.prototype are ignored.
|
|
2132
|
+
const _encode = utils.getSafeProp(_options, 'encode') || buildURL_encode;
|
|
2133
|
+
const serializeFn = utils.getSafeProp(_options, 'serialize');
|
|
2018
2134
|
|
|
2019
2135
|
let serializedParams;
|
|
2020
2136
|
|
|
@@ -2121,6 +2237,7 @@ class InterceptorManager {
|
|
|
2121
2237
|
clarifyTimeoutError: false,
|
|
2122
2238
|
legacyInterceptorReqResOrdering: true,
|
|
2123
2239
|
advertiseZstdAcceptEncoding: false,
|
|
2240
|
+
validateStatusUndefinedResolves: true,
|
|
2124
2241
|
});
|
|
2125
2242
|
|
|
2126
2243
|
;// CONCATENATED MODULE: ../../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
|
|
@@ -2237,6 +2354,19 @@ function toURLEncodedForm(data, options) {
|
|
|
2237
2354
|
|
|
2238
2355
|
|
|
2239
2356
|
|
|
2357
|
+
|
|
2358
|
+
|
|
2359
|
+
const MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;
|
|
2360
|
+
|
|
2361
|
+
function throwIfDepthExceeded(index) {
|
|
2362
|
+
if (index > MAX_DEPTH) {
|
|
2363
|
+
throw new core_AxiosError(
|
|
2364
|
+
'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,
|
|
2365
|
+
core_AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
2366
|
+
);
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2240
2370
|
/**
|
|
2241
2371
|
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
|
|
2242
2372
|
*
|
|
@@ -2249,9 +2379,16 @@ function parsePropPath(name) {
|
|
|
2249
2379
|
// foo.x.y.z
|
|
2250
2380
|
// foo-x-y-z
|
|
2251
2381
|
// foo x y z
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2382
|
+
const path = [];
|
|
2383
|
+
const pattern = /\w+|\[(\w*)]/g;
|
|
2384
|
+
let match;
|
|
2385
|
+
|
|
2386
|
+
while ((match = pattern.exec(name)) !== null) {
|
|
2387
|
+
throwIfDepthExceeded(path.length);
|
|
2388
|
+
path.push(match[0] === '[]' ? '' : match[1] || match[0]);
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
return path;
|
|
2255
2392
|
}
|
|
2256
2393
|
|
|
2257
2394
|
/**
|
|
@@ -2283,6 +2420,8 @@ function arrayToObject(arr) {
|
|
|
2283
2420
|
*/
|
|
2284
2421
|
function formDataToJSON(formData) {
|
|
2285
2422
|
function buildPath(path, value, target, index) {
|
|
2423
|
+
throwIfDepthExceeded(index);
|
|
2424
|
+
|
|
2286
2425
|
let name = path[index++];
|
|
2287
2426
|
|
|
2288
2427
|
if (name === '__proto__') return true;
|
|
@@ -2828,7 +2967,11 @@ const asyncDecorator =
|
|
|
2828
2967
|
const cookie = cookies[i].replace(/^\s+/, '');
|
|
2829
2968
|
const eq = cookie.indexOf('=');
|
|
2830
2969
|
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
2831
|
-
|
|
2970
|
+
try {
|
|
2971
|
+
return decodeURIComponent(cookie.slice(eq + 1));
|
|
2972
|
+
} catch (e) {
|
|
2973
|
+
return cookie.slice(eq + 1);
|
|
2974
|
+
}
|
|
2832
2975
|
}
|
|
2833
2976
|
}
|
|
2834
2977
|
return null;
|
|
@@ -2891,6 +3034,32 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
2891
3034
|
|
|
2892
3035
|
|
|
2893
3036
|
|
|
3037
|
+
|
|
3038
|
+
const malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
3039
|
+
const httpProtocolControlCharacters = /[\t\n\r]/g;
|
|
3040
|
+
|
|
3041
|
+
function stripLeadingC0ControlOrSpace(url) {
|
|
3042
|
+
let i = 0;
|
|
3043
|
+
while (i < url.length && url.charCodeAt(i) <= 0x20) {
|
|
3044
|
+
i++;
|
|
3045
|
+
}
|
|
3046
|
+
return url.slice(i);
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
function normalizeURLForProtocolCheck(url) {
|
|
3050
|
+
return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
function assertValidHttpProtocolURL(url, config) {
|
|
3054
|
+
if (typeof url === 'string' && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url))) {
|
|
3055
|
+
throw new core_AxiosError(
|
|
3056
|
+
'Invalid URL: missing "//" after protocol',
|
|
3057
|
+
core_AxiosError.ERR_INVALID_URL,
|
|
3058
|
+
config
|
|
3059
|
+
);
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
|
|
2894
3063
|
/**
|
|
2895
3064
|
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
2896
3065
|
* only when the requestedURL is not already an absolute URL.
|
|
@@ -2901,9 +3070,11 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
2901
3070
|
*
|
|
2902
3071
|
* @returns {string} The combined full path
|
|
2903
3072
|
*/
|
|
2904
|
-
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
3073
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
3074
|
+
assertValidHttpProtocolURL(requestedURL, config);
|
|
2905
3075
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2906
3076
|
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
3077
|
+
assertValidHttpProtocolURL(baseURL, config);
|
|
2907
3078
|
return combineURLs(baseURL, requestedURL);
|
|
2908
3079
|
}
|
|
2909
3080
|
return requestedURL;
|
|
@@ -2928,6 +3099,7 @@ const headersToObject = (thing) => (thing instanceof core_AxiosHeaders ? { ...th
|
|
|
2928
3099
|
*/
|
|
2929
3100
|
function mergeConfig(config1, config2) {
|
|
2930
3101
|
// eslint-disable-next-line no-param-reassign
|
|
3102
|
+
config1 = config1 || {};
|
|
2931
3103
|
config2 = config2 || {};
|
|
2932
3104
|
|
|
2933
3105
|
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
@@ -2980,6 +3152,28 @@ function mergeConfig(config1, config2) {
|
|
|
2980
3152
|
}
|
|
2981
3153
|
}
|
|
2982
3154
|
|
|
3155
|
+
function getMergedTransitionalOption(prop) {
|
|
3156
|
+
const transitional2 = utils.hasOwnProp(config2, 'transitional') ? config2.transitional : undefined;
|
|
3157
|
+
|
|
3158
|
+
if (!utils.isUndefined(transitional2)) {
|
|
3159
|
+
if (utils.isPlainObject(transitional2)) {
|
|
3160
|
+
if (utils.hasOwnProp(transitional2, prop)) {
|
|
3161
|
+
return transitional2[prop];
|
|
3162
|
+
}
|
|
3163
|
+
} else {
|
|
3164
|
+
return undefined;
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
|
|
3168
|
+
const transitional1 = utils.hasOwnProp(config1, 'transitional') ? config1.transitional : undefined;
|
|
3169
|
+
|
|
3170
|
+
if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) {
|
|
3171
|
+
return transitional1[prop];
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
return undefined;
|
|
3175
|
+
}
|
|
3176
|
+
|
|
2983
3177
|
// eslint-disable-next-line consistent-return
|
|
2984
3178
|
function mergeDirectKeys(a, b, prop) {
|
|
2985
3179
|
if (utils.hasOwnProp(config2, prop)) {
|
|
@@ -3032,6 +3226,18 @@ function mergeConfig(config1, config2) {
|
|
|
3032
3226
|
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
3033
3227
|
});
|
|
3034
3228
|
|
|
3229
|
+
if (
|
|
3230
|
+
utils.hasOwnProp(config2, 'validateStatus') &&
|
|
3231
|
+
utils.isUndefined(config2.validateStatus) &&
|
|
3232
|
+
getMergedTransitionalOption('validateStatusUndefinedResolves') === false
|
|
3233
|
+
) {
|
|
3234
|
+
if (utils.hasOwnProp(config1, 'validateStatus')) {
|
|
3235
|
+
config.validateStatus = getMergedValue(undefined, config1.validateStatus);
|
|
3236
|
+
} else {
|
|
3237
|
+
delete config.validateStatus;
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3035
3241
|
return config;
|
|
3036
3242
|
}
|
|
3037
3243
|
|
|
@@ -3045,6 +3251,7 @@ function mergeConfig(config1, config2) {
|
|
|
3045
3251
|
|
|
3046
3252
|
|
|
3047
3253
|
|
|
3254
|
+
|
|
3048
3255
|
const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
3049
3256
|
|
|
3050
3257
|
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
@@ -3053,7 +3260,7 @@ function setFormDataHeaders(headers, formHeaders, policy) {
|
|
|
3053
3260
|
return;
|
|
3054
3261
|
}
|
|
3055
3262
|
|
|
3056
|
-
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
3263
|
+
Object.entries(formHeaders || {}).forEach(([key, val]) => {
|
|
3057
3264
|
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
3058
3265
|
headers.set(key, val);
|
|
3059
3266
|
}
|
|
@@ -3093,18 +3300,24 @@ function resolveConfig(config) {
|
|
|
3093
3300
|
newConfig.headers = headers = core_AxiosHeaders.from(headers);
|
|
3094
3301
|
|
|
3095
3302
|
newConfig.url = buildURL(
|
|
3096
|
-
buildFullPath(baseURL, url, allowAbsoluteUrls),
|
|
3303
|
+
buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),
|
|
3097
3304
|
own('params'),
|
|
3098
3305
|
own('paramsSerializer')
|
|
3099
3306
|
);
|
|
3100
3307
|
|
|
3101
3308
|
// HTTP basic authentication
|
|
3102
3309
|
if (auth) {
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3310
|
+
const username = utils.getSafeProp(auth, 'username') || '';
|
|
3311
|
+
const password = utils.getSafeProp(auth, 'password') || '';
|
|
3312
|
+
|
|
3313
|
+
try {
|
|
3314
|
+
headers.set(
|
|
3315
|
+
'Authorization',
|
|
3316
|
+
'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))
|
|
3317
|
+
);
|
|
3318
|
+
} catch (e) {
|
|
3319
|
+
throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
3320
|
+
}
|
|
3108
3321
|
}
|
|
3109
3322
|
|
|
3110
3323
|
if (utils.isFormData(data)) {
|
|
@@ -3370,6 +3583,7 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
|
3370
3583
|
config
|
|
3371
3584
|
)
|
|
3372
3585
|
);
|
|
3586
|
+
done();
|
|
3373
3587
|
return;
|
|
3374
3588
|
}
|
|
3375
3589
|
|
|
@@ -3426,7 +3640,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
3426
3640
|
signals = null;
|
|
3427
3641
|
};
|
|
3428
3642
|
|
|
3429
|
-
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
3643
|
+
signals.forEach((signal) => signal.addEventListener('abort', onabort, { once: true }));
|
|
3430
3644
|
|
|
3431
3645
|
const { signal } = controller;
|
|
3432
3646
|
|
|
@@ -3529,16 +3743,23 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
3529
3743
|
};
|
|
3530
3744
|
|
|
3531
3745
|
;// CONCATENATED MODULE: ../../../node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
|
|
3532
|
-
/* provided dependency */ var estimateDataURLDecodedBytes_Buffer = __webpack_require__(81429)["hp"];
|
|
3533
3746
|
/**
|
|
3534
3747
|
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
|
3535
3748
|
* - For base64: compute exact decoded size using length and padding;
|
|
3536
3749
|
* handle %XX at the character-count level (no string allocation).
|
|
3537
|
-
* - For non-base64:
|
|
3750
|
+
* - For non-base64: compute the exact percent-decoded UTF-8 byte length.
|
|
3538
3751
|
*
|
|
3539
3752
|
* @param {string} url
|
|
3540
3753
|
* @returns {number}
|
|
3541
3754
|
*/
|
|
3755
|
+
const isHexDigit = (charCode) =>
|
|
3756
|
+
(charCode >= 48 && charCode <= 57) ||
|
|
3757
|
+
(charCode >= 65 && charCode <= 70) ||
|
|
3758
|
+
(charCode >= 97 && charCode <= 102);
|
|
3759
|
+
|
|
3760
|
+
const isPercentEncodedByte = (str, i, len) =>
|
|
3761
|
+
i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
|
|
3762
|
+
|
|
3542
3763
|
function estimateDataURLDecodedBytes(url) {
|
|
3543
3764
|
if (!url || typeof url !== 'string') return 0;
|
|
3544
3765
|
if (!url.startsWith('data:')) return 0;
|
|
@@ -3558,9 +3779,7 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
3558
3779
|
if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
|
|
3559
3780
|
const a = body.charCodeAt(i + 1);
|
|
3560
3781
|
const b = body.charCodeAt(i + 2);
|
|
3561
|
-
const isHex =
|
|
3562
|
-
((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
|
|
3563
|
-
((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
|
|
3782
|
+
const isHex = isHexDigit(a) && isHexDigit(b);
|
|
3564
3783
|
|
|
3565
3784
|
if (isHex) {
|
|
3566
3785
|
effectiveLen -= 2;
|
|
@@ -3601,18 +3820,17 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
3601
3820
|
return bytes > 0 ? bytes : 0;
|
|
3602
3821
|
}
|
|
3603
3822
|
|
|
3604
|
-
if (typeof estimateDataURLDecodedBytes_Buffer !== 'undefined' && typeof estimateDataURLDecodedBytes_Buffer.byteLength === 'function') {
|
|
3605
|
-
return estimateDataURLDecodedBytes_Buffer.byteLength(body, 'utf8');
|
|
3606
|
-
}
|
|
3607
|
-
|
|
3608
3823
|
// Compute UTF-8 byte length directly from UTF-16 code units without allocating
|
|
3609
3824
|
// a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
|
|
3610
|
-
//
|
|
3611
|
-
//
|
|
3825
|
+
// Valid %XX triplets count as one decoded byte; this matches the bytes that
|
|
3826
|
+
// decodeURIComponent(body) would produce before Buffer re-encodes the string.
|
|
3612
3827
|
let bytes = 0;
|
|
3613
3828
|
for (let i = 0, len = body.length; i < len; i++) {
|
|
3614
3829
|
const c = body.charCodeAt(i);
|
|
3615
|
-
if (c
|
|
3830
|
+
if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
|
|
3831
|
+
bytes += 1;
|
|
3832
|
+
i += 2;
|
|
3833
|
+
} else if (c < 0x80) {
|
|
3616
3834
|
bytes += 1;
|
|
3617
3835
|
} else if (c < 0x800) {
|
|
3618
3836
|
bytes += 2;
|
|
@@ -3632,7 +3850,7 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
3632
3850
|
}
|
|
3633
3851
|
|
|
3634
3852
|
;// CONCATENATED MODULE: ../../../node_modules/axios/lib/env/data.js
|
|
3635
|
-
const VERSION = "1.
|
|
3853
|
+
const VERSION = "1.18.1";
|
|
3636
3854
|
;// CONCATENATED MODULE: ../../../node_modules/axios/lib/adapters/fetch.js
|
|
3637
3855
|
|
|
3638
3856
|
|
|
@@ -3866,14 +4084,28 @@ const factory = (env) => {
|
|
|
3866
4084
|
|
|
3867
4085
|
let requestContentLength;
|
|
3868
4086
|
|
|
4087
|
+
// AxiosError we raise while the request body is being streamed. Captured
|
|
4088
|
+
// by identity so the catch block can surface it directly, regardless of
|
|
4089
|
+
// how the runtime wraps the resulting fetch rejection (undici exposes it
|
|
4090
|
+
// as `err.cause`; some browsers drop the original error entirely).
|
|
4091
|
+
let pendingBodyError = null;
|
|
4092
|
+
|
|
4093
|
+
const maxBodyLengthError = () =>
|
|
4094
|
+
new core_AxiosError(
|
|
4095
|
+
'Request body larger than maxBodyLength limit',
|
|
4096
|
+
core_AxiosError.ERR_BAD_REQUEST,
|
|
4097
|
+
config,
|
|
4098
|
+
request
|
|
4099
|
+
);
|
|
4100
|
+
|
|
3869
4101
|
try {
|
|
3870
4102
|
// HTTP basic authentication
|
|
3871
4103
|
let auth = undefined;
|
|
3872
4104
|
const configAuth = own('auth');
|
|
3873
4105
|
|
|
3874
4106
|
if (configAuth) {
|
|
3875
|
-
const username = configAuth
|
|
3876
|
-
const password = configAuth
|
|
4107
|
+
const username = utils.getSafeProp(configAuth, 'username') || '';
|
|
4108
|
+
const password = utils.getSafeProp(configAuth, 'password') || '';
|
|
3877
4109
|
auth = {
|
|
3878
4110
|
username,
|
|
3879
4111
|
password
|
|
@@ -3922,53 +4154,96 @@ const factory = (env) => {
|
|
|
3922
4154
|
}
|
|
3923
4155
|
}
|
|
3924
4156
|
|
|
3925
|
-
// Enforce maxBodyLength against
|
|
3926
|
-
//
|
|
3927
|
-
//
|
|
3928
|
-
//
|
|
4157
|
+
// Enforce maxBodyLength against known-size bodies before dispatch using
|
|
4158
|
+
// the body's *actual* size — never a caller-declared Content-Length,
|
|
4159
|
+
// which could under-report to slip an oversized body past the check.
|
|
4160
|
+
// Unknown-size streams return undefined here and are counted per-chunk
|
|
4161
|
+
// below as fetch consumes them.
|
|
3929
4162
|
if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
|
|
3930
|
-
const outboundLength = await
|
|
3931
|
-
if (
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
throw new core_AxiosError(
|
|
3937
|
-
'Request body larger than maxBodyLength limit',
|
|
3938
|
-
core_AxiosError.ERR_BAD_REQUEST,
|
|
3939
|
-
config,
|
|
3940
|
-
request
|
|
3941
|
-
);
|
|
4163
|
+
const outboundLength = await getBodyLength(data);
|
|
4164
|
+
if (typeof outboundLength === 'number' && isFinite(outboundLength)) {
|
|
4165
|
+
requestContentLength = outboundLength;
|
|
4166
|
+
if (outboundLength > maxBodyLength) {
|
|
4167
|
+
throw maxBodyLengthError();
|
|
4168
|
+
}
|
|
3942
4169
|
}
|
|
3943
4170
|
}
|
|
3944
4171
|
|
|
4172
|
+
// A streamed body under maxBodyLength must be counted as fetch consumes
|
|
4173
|
+
// it; its size is never trusted from a caller-declared Content-Length.
|
|
4174
|
+
const mustEnforceStreamBody =
|
|
4175
|
+
hasMaxBodyLength && (utils.isReadableStream(data) || utils.isStream(data));
|
|
4176
|
+
|
|
4177
|
+
const trackRequestStream = (stream, onProgress, flush) =>
|
|
4178
|
+
trackStream(
|
|
4179
|
+
stream,
|
|
4180
|
+
DEFAULT_CHUNK_SIZE,
|
|
4181
|
+
(loadedBytes) => {
|
|
4182
|
+
if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
|
|
4183
|
+
throw (pendingBodyError = maxBodyLengthError());
|
|
4184
|
+
}
|
|
4185
|
+
onProgress && onProgress(loadedBytes);
|
|
4186
|
+
},
|
|
4187
|
+
flush
|
|
4188
|
+
);
|
|
4189
|
+
|
|
3945
4190
|
if (
|
|
3946
|
-
onUploadProgress &&
|
|
3947
4191
|
supportsRequestStream &&
|
|
3948
4192
|
method !== 'get' &&
|
|
3949
4193
|
method !== 'head' &&
|
|
3950
|
-
(
|
|
4194
|
+
(onUploadProgress || mustEnforceStreamBody)
|
|
3951
4195
|
) {
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
4196
|
+
requestContentLength =
|
|
4197
|
+
requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
|
|
4198
|
+
|
|
4199
|
+
// A declared length of 0 is only trusted to skip the wrap when we are
|
|
4200
|
+
// not enforcing a stream limit (which must not rely on that header).
|
|
4201
|
+
if (requestContentLength !== 0 || mustEnforceStreamBody) {
|
|
4202
|
+
let _request = new Request(url, {
|
|
4203
|
+
method: 'POST',
|
|
4204
|
+
body: data,
|
|
4205
|
+
duplex: 'half',
|
|
4206
|
+
});
|
|
3957
4207
|
|
|
3958
|
-
|
|
4208
|
+
let contentTypeHeader;
|
|
3959
4209
|
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
4210
|
+
if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
4211
|
+
headers.setContentType(contentTypeHeader);
|
|
4212
|
+
}
|
|
3963
4213
|
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
4214
|
+
if (_request.body) {
|
|
4215
|
+
const [onProgress, flush] =
|
|
4216
|
+
(onUploadProgress &&
|
|
4217
|
+
progressEventDecorator(
|
|
4218
|
+
requestContentLength,
|
|
4219
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
4220
|
+
)) ||
|
|
4221
|
+
[];
|
|
3969
4222
|
|
|
3970
|
-
|
|
4223
|
+
data = trackRequestStream(_request.body, onProgress, flush);
|
|
4224
|
+
}
|
|
3971
4225
|
}
|
|
4226
|
+
} else if (
|
|
4227
|
+
mustEnforceStreamBody &&
|
|
4228
|
+
!isRequestSupported &&
|
|
4229
|
+
isReadableStreamSupported &&
|
|
4230
|
+
method !== 'get' &&
|
|
4231
|
+
method !== 'head'
|
|
4232
|
+
) {
|
|
4233
|
+
data = trackRequestStream(data);
|
|
4234
|
+
} else if (
|
|
4235
|
+
mustEnforceStreamBody &&
|
|
4236
|
+
isRequestSupported &&
|
|
4237
|
+
!supportsRequestStream &&
|
|
4238
|
+
method !== 'get' &&
|
|
4239
|
+
method !== 'head'
|
|
4240
|
+
) {
|
|
4241
|
+
throw new core_AxiosError(
|
|
4242
|
+
'Stream request bodies are not supported by the current fetch implementation',
|
|
4243
|
+
core_AxiosError.ERR_NOT_SUPPORT,
|
|
4244
|
+
config,
|
|
4245
|
+
request
|
|
4246
|
+
);
|
|
3972
4247
|
}
|
|
3973
4248
|
|
|
3974
4249
|
if (!utils.isString(withCredentials)) {
|
|
@@ -3993,7 +4268,7 @@ const factory = (env) => {
|
|
|
3993
4268
|
}
|
|
3994
4269
|
|
|
3995
4270
|
// Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
|
|
3996
|
-
headers.set('User-Agent', 'axios/' + (/* inlined export .VERSION */"1.
|
|
4271
|
+
headers.set('User-Agent', 'axios/' + (/* inlined export .VERSION */"1.18.1"), false);
|
|
3997
4272
|
|
|
3998
4273
|
const resolvedOptions = {
|
|
3999
4274
|
...fetchOptions,
|
|
@@ -4011,10 +4286,12 @@ const factory = (env) => {
|
|
|
4011
4286
|
? _fetch(request, fetchOptions)
|
|
4012
4287
|
: _fetch(url, resolvedOptions));
|
|
4013
4288
|
|
|
4289
|
+
const responseHeaders = core_AxiosHeaders.from(response.headers);
|
|
4290
|
+
|
|
4014
4291
|
// Cheap pre-check: if the server honestly declares a content-length that
|
|
4015
4292
|
// already exceeds the cap, reject before we start streaming.
|
|
4016
4293
|
if (hasMaxContentLength) {
|
|
4017
|
-
const declaredLength = utils.toFiniteNumber(
|
|
4294
|
+
const declaredLength = utils.toFiniteNumber(responseHeaders.getContentLength());
|
|
4018
4295
|
if (declaredLength != null && declaredLength > maxContentLength) {
|
|
4019
4296
|
throw new core_AxiosError(
|
|
4020
4297
|
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
@@ -4039,7 +4316,7 @@ const factory = (env) => {
|
|
|
4039
4316
|
options[prop] = response[prop];
|
|
4040
4317
|
});
|
|
4041
4318
|
|
|
4042
|
-
const responseContentLength = utils.toFiniteNumber(
|
|
4319
|
+
const responseContentLength = utils.toFiniteNumber(responseHeaders.getContentLength());
|
|
4043
4320
|
|
|
4044
4321
|
const [onProgress, flush] =
|
|
4045
4322
|
(onDownloadProgress &&
|
|
@@ -4130,23 +4407,55 @@ const factory = (env) => {
|
|
|
4130
4407
|
const canceledError = composedSignal.reason;
|
|
4131
4408
|
canceledError.config = config;
|
|
4132
4409
|
request && (canceledError.request = request);
|
|
4133
|
-
err !== canceledError
|
|
4410
|
+
if (err !== canceledError) {
|
|
4411
|
+
// Non-enumerable to match native Error `cause` semantics so loggers
|
|
4412
|
+
// don't recurse into circular fetch internals (see #7205).
|
|
4413
|
+
Object.defineProperty(canceledError, 'cause', {
|
|
4414
|
+
__proto__: null,
|
|
4415
|
+
value: err,
|
|
4416
|
+
writable: true,
|
|
4417
|
+
enumerable: false,
|
|
4418
|
+
configurable: true,
|
|
4419
|
+
});
|
|
4420
|
+
}
|
|
4134
4421
|
throw canceledError;
|
|
4135
4422
|
}
|
|
4136
4423
|
|
|
4424
|
+
// Surface a maxBodyLength violation we raised while the request body was
|
|
4425
|
+
// being streamed. Matching by identity (rather than reading
|
|
4426
|
+
// `err.cause.isAxiosError`) keeps the error deterministic across runtimes
|
|
4427
|
+
// and avoids both prototype-pollution reads and mis-attributing a foreign
|
|
4428
|
+
// AxiosError that merely happened to land in `err.cause`.
|
|
4429
|
+
if (pendingBodyError) {
|
|
4430
|
+
request && !pendingBodyError.request && (pendingBodyError.request = request);
|
|
4431
|
+
throw pendingBodyError;
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
// Re-throw AxiosErrors we raised synchronously (data: URL / content-length
|
|
4435
|
+
// pre-checks, response size enforcement) without re-wrapping them.
|
|
4436
|
+
if (err instanceof core_AxiosError) {
|
|
4437
|
+
request && !err.request && (err.request = request);
|
|
4438
|
+
throw err;
|
|
4439
|
+
}
|
|
4440
|
+
|
|
4137
4441
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
err && err.response
|
|
4145
|
-
),
|
|
4146
|
-
{
|
|
4147
|
-
cause: err.cause || err,
|
|
4148
|
-
}
|
|
4442
|
+
const networkError = new core_AxiosError(
|
|
4443
|
+
'Network Error',
|
|
4444
|
+
core_AxiosError.ERR_NETWORK,
|
|
4445
|
+
config,
|
|
4446
|
+
request,
|
|
4447
|
+
err && err.response
|
|
4149
4448
|
);
|
|
4449
|
+
// Non-enumerable to match native Error `cause` semantics so loggers
|
|
4450
|
+
// don't recurse into circular fetch internals (see #7205).
|
|
4451
|
+
Object.defineProperty(networkError, 'cause', {
|
|
4452
|
+
__proto__: null,
|
|
4453
|
+
value: err.cause || err,
|
|
4454
|
+
writable: true,
|
|
4455
|
+
enumerable: false,
|
|
4456
|
+
configurable: true,
|
|
4457
|
+
});
|
|
4458
|
+
throw networkError;
|
|
4150
4459
|
}
|
|
4151
4460
|
|
|
4152
4461
|
throw core_AxiosError.from(err, err && err.code, config, request, err && err.response);
|
|
@@ -4293,7 +4602,7 @@ function getAdapter(adapters, config) {
|
|
|
4293
4602
|
|
|
4294
4603
|
throw new core_AxiosError(
|
|
4295
4604
|
`There is no suitable adapter to dispatch the request ` + s,
|
|
4296
|
-
|
|
4605
|
+
core_AxiosError.ERR_NOT_SUPPORT
|
|
4297
4606
|
);
|
|
4298
4607
|
}
|
|
4299
4608
|
|
|
@@ -4438,7 +4747,7 @@ validators.transitional = function transitional(validator, version, message) {
|
|
|
4438
4747
|
function formatMessage(opt, desc) {
|
|
4439
4748
|
return (
|
|
4440
4749
|
'[Axios v' +
|
|
4441
|
-
(/* inlined export .VERSION */"1.
|
|
4750
|
+
(/* inlined export .VERSION */"1.18.1") +
|
|
4442
4751
|
"] Transitional option '" +
|
|
4443
4752
|
opt +
|
|
4444
4753
|
"'" +
|
|
@@ -4490,7 +4799,7 @@ validators.spelling = function spelling(correctSpelling) {
|
|
|
4490
4799
|
*/
|
|
4491
4800
|
|
|
4492
4801
|
function assertOptions(options, schema, allowUnknown) {
|
|
4493
|
-
if (typeof options !== 'object') {
|
|
4802
|
+
if (typeof options !== 'object' || options === null) {
|
|
4494
4803
|
throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE);
|
|
4495
4804
|
}
|
|
4496
4805
|
const keys = Object.keys(options);
|
|
@@ -4627,6 +4936,7 @@ class Axios {
|
|
|
4627
4936
|
clarifyTimeoutError: Axios_validators.transitional(Axios_validators.boolean),
|
|
4628
4937
|
legacyInterceptorReqResOrdering: Axios_validators.transitional(Axios_validators.boolean),
|
|
4629
4938
|
advertiseZstdAcceptEncoding: Axios_validators.transitional(Axios_validators.boolean),
|
|
4939
|
+
validateStatusUndefinedResolves: Axios_validators.transitional(Axios_validators.boolean),
|
|
4630
4940
|
},
|
|
4631
4941
|
false
|
|
4632
4942
|
);
|
|
@@ -4758,7 +5068,7 @@ class Axios {
|
|
|
4758
5068
|
|
|
4759
5069
|
getUri(config) {
|
|
4760
5070
|
config = mergeConfig(this.defaults, config);
|
|
4761
|
-
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
5071
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
|
|
4762
5072
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
4763
5073
|
}
|
|
4764
5074
|
}
|
|
@@ -4771,7 +5081,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
|
|
|
4771
5081
|
mergeConfig(config || {}, {
|
|
4772
5082
|
method,
|
|
4773
5083
|
url,
|
|
4774
|
-
data: (config
|
|
5084
|
+
data: config && utils.hasOwnProp(config, 'data') ? config.data : undefined,
|
|
4775
5085
|
})
|
|
4776
5086
|
);
|
|
4777
5087
|
};
|
|
@@ -5124,7 +5434,7 @@ axios.Axios = core_Axios;
|
|
|
5124
5434
|
axios.CanceledError = cancel_CanceledError;
|
|
5125
5435
|
axios.CancelToken = cancel_CancelToken;
|
|
5126
5436
|
axios.isCancel = isCancel;
|
|
5127
|
-
axios.VERSION = (/* inlined export .VERSION */"1.
|
|
5437
|
+
axios.VERSION = (/* inlined export .VERSION */"1.18.1");
|
|
5128
5438
|
axios.toFormData = helpers_toFormData;
|
|
5129
5439
|
|
|
5130
5440
|
// Expose AxiosError class
|