axios 1.6.0 → 1.6.2
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 +44 -0
- package/README.md +5 -2
- package/dist/axios.js +222 -172
- 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 +177 -180
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +177 -180
- 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 +240 -192
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +1 -0
- package/index.d.ts +1 -0
- package/lib/adapters/xhr.js +14 -12
- package/lib/core/mergeConfig.js +1 -0
- package/lib/env/data.js +1 -1
- package/lib/helpers/cookies.js +39 -49
- package/lib/helpers/isURLSameOrigin.js +2 -2
- package/lib/platform/browser/index.js +0 -51
- package/lib/platform/common/utils.js +47 -0
- package/lib/platform/index.js +5 -1
- package/package.json +2 -1
package/dist/browser/axios.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.6.
|
1
|
+
// Axios v1.6.2 Copyright (c) 2023 Matt Zabriskie and contributors
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
function bind(fn, thisArg) {
|
@@ -673,7 +673,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
673
673
|
const isThenable = (thing) =>
|
674
674
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
675
675
|
|
676
|
-
var utils = {
|
676
|
+
var utils$1 = {
|
677
677
|
isArray,
|
678
678
|
isArrayBuffer,
|
679
679
|
isBuffer,
|
@@ -755,7 +755,7 @@ function AxiosError(message, code, config, request, response) {
|
|
755
755
|
response && (this.response = response);
|
756
756
|
}
|
757
757
|
|
758
|
-
utils.inherits(AxiosError, Error, {
|
758
|
+
utils$1.inherits(AxiosError, Error, {
|
759
759
|
toJSON: function toJSON() {
|
760
760
|
return {
|
761
761
|
// Standard
|
@@ -770,7 +770,7 @@ utils.inherits(AxiosError, Error, {
|
|
770
770
|
columnNumber: this.columnNumber,
|
771
771
|
stack: this.stack,
|
772
772
|
// Axios
|
773
|
-
config: utils.toJSONObject(this.config),
|
773
|
+
config: utils$1.toJSONObject(this.config),
|
774
774
|
code: this.code,
|
775
775
|
status: this.response && this.response.status ? this.response.status : null
|
776
776
|
};
|
@@ -805,7 +805,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
805
805
|
AxiosError.from = (error, code, config, request, response, customProps) => {
|
806
806
|
const axiosError = Object.create(prototype$1);
|
807
807
|
|
808
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
808
|
+
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
809
809
|
return obj !== Error.prototype;
|
810
810
|
}, prop => {
|
811
811
|
return prop !== 'isAxiosError';
|
@@ -833,7 +833,7 @@ var httpAdapter = null;
|
|
833
833
|
* @returns {boolean}
|
834
834
|
*/
|
835
835
|
function isVisitable(thing) {
|
836
|
-
return utils.isPlainObject(thing) || utils.isArray(thing);
|
836
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
837
837
|
}
|
838
838
|
|
839
839
|
/**
|
@@ -844,7 +844,7 @@ function isVisitable(thing) {
|
|
844
844
|
* @returns {string} the key without the brackets.
|
845
845
|
*/
|
846
846
|
function removeBrackets(key) {
|
847
|
-
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
847
|
+
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
848
848
|
}
|
849
849
|
|
850
850
|
/**
|
@@ -873,10 +873,10 @@ function renderKey(path, key, dots) {
|
|
873
873
|
* @returns {boolean}
|
874
874
|
*/
|
875
875
|
function isFlatArray(arr) {
|
876
|
-
return utils.isArray(arr) && !arr.some(isVisitable);
|
876
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
877
877
|
}
|
878
878
|
|
879
|
-
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
879
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
880
880
|
return /^is[A-Z]/.test(prop);
|
881
881
|
});
|
882
882
|
|
@@ -904,7 +904,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
904
904
|
* @returns
|
905
905
|
*/
|
906
906
|
function toFormData(obj, formData, options) {
|
907
|
-
if (!utils.isObject(obj)) {
|
907
|
+
if (!utils$1.isObject(obj)) {
|
908
908
|
throw new TypeError('target must be an object');
|
909
909
|
}
|
910
910
|
|
@@ -912,13 +912,13 @@ function toFormData(obj, formData, options) {
|
|
912
912
|
formData = formData || new (FormData)();
|
913
913
|
|
914
914
|
// eslint-disable-next-line no-param-reassign
|
915
|
-
options = utils.toFlatObject(options, {
|
915
|
+
options = utils$1.toFlatObject(options, {
|
916
916
|
metaTokens: true,
|
917
917
|
dots: false,
|
918
918
|
indexes: false
|
919
919
|
}, false, function defined(option, source) {
|
920
920
|
// eslint-disable-next-line no-eq-null,eqeqeq
|
921
|
-
return !utils.isUndefined(source[option]);
|
921
|
+
return !utils$1.isUndefined(source[option]);
|
922
922
|
});
|
923
923
|
|
924
924
|
const metaTokens = options.metaTokens;
|
@@ -927,24 +927,24 @@ function toFormData(obj, formData, options) {
|
|
927
927
|
const dots = options.dots;
|
928
928
|
const indexes = options.indexes;
|
929
929
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
930
|
-
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
930
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
931
931
|
|
932
|
-
if (!utils.isFunction(visitor)) {
|
932
|
+
if (!utils$1.isFunction(visitor)) {
|
933
933
|
throw new TypeError('visitor must be a function');
|
934
934
|
}
|
935
935
|
|
936
936
|
function convertValue(value) {
|
937
937
|
if (value === null) return '';
|
938
938
|
|
939
|
-
if (utils.isDate(value)) {
|
939
|
+
if (utils$1.isDate(value)) {
|
940
940
|
return value.toISOString();
|
941
941
|
}
|
942
942
|
|
943
|
-
if (!useBlob && utils.isBlob(value)) {
|
943
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
944
944
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
945
945
|
}
|
946
946
|
|
947
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
947
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
948
948
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
949
949
|
}
|
950
950
|
|
@@ -965,20 +965,20 @@ function toFormData(obj, formData, options) {
|
|
965
965
|
let arr = value;
|
966
966
|
|
967
967
|
if (value && !path && typeof value === 'object') {
|
968
|
-
if (utils.endsWith(key, '{}')) {
|
968
|
+
if (utils$1.endsWith(key, '{}')) {
|
969
969
|
// eslint-disable-next-line no-param-reassign
|
970
970
|
key = metaTokens ? key : key.slice(0, -2);
|
971
971
|
// eslint-disable-next-line no-param-reassign
|
972
972
|
value = JSON.stringify(value);
|
973
973
|
} else if (
|
974
|
-
(utils.isArray(value) && isFlatArray(value)) ||
|
975
|
-
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
|
974
|
+
(utils$1.isArray(value) && isFlatArray(value)) ||
|
975
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
976
976
|
)) {
|
977
977
|
// eslint-disable-next-line no-param-reassign
|
978
978
|
key = removeBrackets(key);
|
979
979
|
|
980
980
|
arr.forEach(function each(el, index) {
|
981
|
-
!(utils.isUndefined(el) || el === null) && formData.append(
|
981
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
982
982
|
// eslint-disable-next-line no-nested-ternary
|
983
983
|
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
984
984
|
convertValue(el)
|
@@ -1006,7 +1006,7 @@ function toFormData(obj, formData, options) {
|
|
1006
1006
|
});
|
1007
1007
|
|
1008
1008
|
function build(value, path) {
|
1009
|
-
if (utils.isUndefined(value)) return;
|
1009
|
+
if (utils$1.isUndefined(value)) return;
|
1010
1010
|
|
1011
1011
|
if (stack.indexOf(value) !== -1) {
|
1012
1012
|
throw Error('Circular reference detected in ' + path.join('.'));
|
@@ -1014,9 +1014,9 @@ function toFormData(obj, formData, options) {
|
|
1014
1014
|
|
1015
1015
|
stack.push(value);
|
1016
1016
|
|
1017
|
-
utils.forEach(value, function each(el, key) {
|
1018
|
-
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
|
1019
|
-
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
|
1017
|
+
utils$1.forEach(value, function each(el, key) {
|
1018
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
1019
|
+
formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
|
1020
1020
|
);
|
1021
1021
|
|
1022
1022
|
if (result === true) {
|
@@ -1027,7 +1027,7 @@ function toFormData(obj, formData, options) {
|
|
1027
1027
|
stack.pop();
|
1028
1028
|
}
|
1029
1029
|
|
1030
|
-
if (!utils.isObject(obj)) {
|
1030
|
+
if (!utils$1.isObject(obj)) {
|
1031
1031
|
throw new TypeError('data must be an object');
|
1032
1032
|
}
|
1033
1033
|
|
@@ -1131,7 +1131,7 @@ function buildURL(url, params, options) {
|
|
1131
1131
|
if (serializeFn) {
|
1132
1132
|
serializedParams = serializeFn(params, options);
|
1133
1133
|
} else {
|
1134
|
-
serializedParams = utils.isURLSearchParams(params) ?
|
1134
|
+
serializedParams = utils$1.isURLSearchParams(params) ?
|
1135
1135
|
params.toString() :
|
1136
1136
|
new AxiosURLSearchParams(params, options).toString(_encode);
|
1137
1137
|
}
|
@@ -1206,7 +1206,7 @@ class InterceptorManager {
|
|
1206
1206
|
* @returns {void}
|
1207
1207
|
*/
|
1208
1208
|
forEach(fn) {
|
1209
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
1209
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
1210
1210
|
if (h !== null) {
|
1211
1211
|
fn(h);
|
1212
1212
|
}
|
@@ -1228,6 +1228,18 @@ var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
1228
1228
|
|
1229
1229
|
var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
1230
1230
|
|
1231
|
+
var platform$1 = {
|
1232
|
+
isBrowser: true,
|
1233
|
+
classes: {
|
1234
|
+
URLSearchParams: URLSearchParams$1,
|
1235
|
+
FormData: FormData$1,
|
1236
|
+
Blob: Blob$1
|
1237
|
+
},
|
1238
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1239
|
+
};
|
1240
|
+
|
1241
|
+
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
1242
|
+
|
1231
1243
|
/**
|
1232
1244
|
* Determine if we're running in a standard browser environment
|
1233
1245
|
*
|
@@ -1245,18 +1257,10 @@ var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
1245
1257
|
*
|
1246
1258
|
* @returns {boolean}
|
1247
1259
|
*/
|
1248
|
-
const
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
product === 'NativeScript' ||
|
1253
|
-
product === 'NS')
|
1254
|
-
) {
|
1255
|
-
return false;
|
1256
|
-
}
|
1257
|
-
|
1258
|
-
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
1259
|
-
})();
|
1260
|
+
const hasStandardBrowserEnv = (
|
1261
|
+
(product) => {
|
1262
|
+
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
1263
|
+
})(typeof navigator !== 'undefined' && navigator.product);
|
1260
1264
|
|
1261
1265
|
/**
|
1262
1266
|
* Determine if we're running in a standard browser webWorker environment
|
@@ -1267,7 +1271,7 @@ const isStandardBrowserEnv = (() => {
|
|
1267
1271
|
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
1268
1272
|
* This leads to a problem when axios post `FormData` in webWorker
|
1269
1273
|
*/
|
1270
|
-
|
1274
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
1271
1275
|
return (
|
1272
1276
|
typeof WorkerGlobalScope !== 'undefined' &&
|
1273
1277
|
// eslint-disable-next-line no-undef
|
@@ -1276,23 +1280,22 @@ const isStandardBrowserEnv = (() => {
|
|
1276
1280
|
);
|
1277
1281
|
})();
|
1278
1282
|
|
1283
|
+
var utils = /*#__PURE__*/Object.freeze({
|
1284
|
+
__proto__: null,
|
1285
|
+
hasBrowserEnv: hasBrowserEnv,
|
1286
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
1287
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv
|
1288
|
+
});
|
1279
1289
|
|
1280
1290
|
var platform = {
|
1281
|
-
|
1282
|
-
|
1283
|
-
URLSearchParams: URLSearchParams$1,
|
1284
|
-
FormData: FormData$1,
|
1285
|
-
Blob: Blob$1
|
1286
|
-
},
|
1287
|
-
isStandardBrowserEnv,
|
1288
|
-
isStandardBrowserWebWorkerEnv,
|
1289
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1291
|
+
...utils,
|
1292
|
+
...platform$1
|
1290
1293
|
};
|
1291
1294
|
|
1292
1295
|
function toURLEncodedForm(data, options) {
|
1293
1296
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
1294
1297
|
visitor: function(value, key, path, helpers) {
|
1295
|
-
if (platform.isNode && utils.isBuffer(value)) {
|
1298
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
1296
1299
|
this.append(key, value.toString('base64'));
|
1297
1300
|
return false;
|
1298
1301
|
}
|
@@ -1314,7 +1317,7 @@ function parsePropPath(name) {
|
|
1314
1317
|
// foo.x.y.z
|
1315
1318
|
// foo-x-y-z
|
1316
1319
|
// foo x y z
|
1317
|
-
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
1320
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
1318
1321
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
1319
1322
|
});
|
1320
1323
|
}
|
@@ -1351,10 +1354,10 @@ function formDataToJSON(formData) {
|
|
1351
1354
|
let name = path[index++];
|
1352
1355
|
const isNumericKey = Number.isFinite(+name);
|
1353
1356
|
const isLast = index >= path.length;
|
1354
|
-
name = !name && utils.isArray(target) ? target.length : name;
|
1357
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
1355
1358
|
|
1356
1359
|
if (isLast) {
|
1357
|
-
if (utils.hasOwnProp(target, name)) {
|
1360
|
+
if (utils$1.hasOwnProp(target, name)) {
|
1358
1361
|
target[name] = [target[name], value];
|
1359
1362
|
} else {
|
1360
1363
|
target[name] = value;
|
@@ -1363,23 +1366,23 @@ function formDataToJSON(formData) {
|
|
1363
1366
|
return !isNumericKey;
|
1364
1367
|
}
|
1365
1368
|
|
1366
|
-
if (!target[name] || !utils.isObject(target[name])) {
|
1369
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
1367
1370
|
target[name] = [];
|
1368
1371
|
}
|
1369
1372
|
|
1370
1373
|
const result = buildPath(path, value, target[name], index);
|
1371
1374
|
|
1372
|
-
if (result && utils.isArray(target[name])) {
|
1375
|
+
if (result && utils$1.isArray(target[name])) {
|
1373
1376
|
target[name] = arrayToObject(target[name]);
|
1374
1377
|
}
|
1375
1378
|
|
1376
1379
|
return !isNumericKey;
|
1377
1380
|
}
|
1378
1381
|
|
1379
|
-
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
1382
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
1380
1383
|
const obj = {};
|
1381
1384
|
|
1382
|
-
utils.forEachEntry(formData, (name, value) => {
|
1385
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
1383
1386
|
buildPath(parsePropPath(name), value, obj, 0);
|
1384
1387
|
});
|
1385
1388
|
|
@@ -1400,10 +1403,10 @@ function formDataToJSON(formData) {
|
|
1400
1403
|
* @returns {string} A stringified version of the rawValue.
|
1401
1404
|
*/
|
1402
1405
|
function stringifySafely(rawValue, parser, encoder) {
|
1403
|
-
if (utils.isString(rawValue)) {
|
1406
|
+
if (utils$1.isString(rawValue)) {
|
1404
1407
|
try {
|
1405
1408
|
(parser || JSON.parse)(rawValue);
|
1406
|
-
return utils.trim(rawValue);
|
1409
|
+
return utils$1.trim(rawValue);
|
1407
1410
|
} catch (e) {
|
1408
1411
|
if (e.name !== 'SyntaxError') {
|
1409
1412
|
throw e;
|
@@ -1423,13 +1426,13 @@ const defaults = {
|
|
1423
1426
|
transformRequest: [function transformRequest(data, headers) {
|
1424
1427
|
const contentType = headers.getContentType() || '';
|
1425
1428
|
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
1426
|
-
const isObjectPayload = utils.isObject(data);
|
1429
|
+
const isObjectPayload = utils$1.isObject(data);
|
1427
1430
|
|
1428
|
-
if (isObjectPayload && utils.isHTMLForm(data)) {
|
1431
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
1429
1432
|
data = new FormData(data);
|
1430
1433
|
}
|
1431
1434
|
|
1432
|
-
const isFormData = utils.isFormData(data);
|
1435
|
+
const isFormData = utils$1.isFormData(data);
|
1433
1436
|
|
1434
1437
|
if (isFormData) {
|
1435
1438
|
if (!hasJSONContentType) {
|
@@ -1438,18 +1441,18 @@ const defaults = {
|
|
1438
1441
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
1439
1442
|
}
|
1440
1443
|
|
1441
|
-
if (utils.isArrayBuffer(data) ||
|
1442
|
-
utils.isBuffer(data) ||
|
1443
|
-
utils.isStream(data) ||
|
1444
|
-
utils.isFile(data) ||
|
1445
|
-
utils.isBlob(data)
|
1444
|
+
if (utils$1.isArrayBuffer(data) ||
|
1445
|
+
utils$1.isBuffer(data) ||
|
1446
|
+
utils$1.isStream(data) ||
|
1447
|
+
utils$1.isFile(data) ||
|
1448
|
+
utils$1.isBlob(data)
|
1446
1449
|
) {
|
1447
1450
|
return data;
|
1448
1451
|
}
|
1449
|
-
if (utils.isArrayBufferView(data)) {
|
1452
|
+
if (utils$1.isArrayBufferView(data)) {
|
1450
1453
|
return data.buffer;
|
1451
1454
|
}
|
1452
|
-
if (utils.isURLSearchParams(data)) {
|
1455
|
+
if (utils$1.isURLSearchParams(data)) {
|
1453
1456
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
1454
1457
|
return data.toString();
|
1455
1458
|
}
|
@@ -1461,7 +1464,7 @@ const defaults = {
|
|
1461
1464
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
1462
1465
|
}
|
1463
1466
|
|
1464
|
-
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
1467
|
+
if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
1465
1468
|
const _FormData = this.env && this.env.FormData;
|
1466
1469
|
|
1467
1470
|
return toFormData(
|
@@ -1485,7 +1488,7 @@ const defaults = {
|
|
1485
1488
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
1486
1489
|
const JSONRequested = this.responseType === 'json';
|
1487
1490
|
|
1488
|
-
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
1491
|
+
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
1489
1492
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
1490
1493
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
1491
1494
|
|
@@ -1533,7 +1536,7 @@ const defaults = {
|
|
1533
1536
|
}
|
1534
1537
|
};
|
1535
1538
|
|
1536
|
-
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
1539
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
1537
1540
|
defaults.headers[method] = {};
|
1538
1541
|
});
|
1539
1542
|
|
@@ -1541,7 +1544,7 @@ var defaults$1 = defaults;
|
|
1541
1544
|
|
1542
1545
|
// RawAxiosHeaders whose duplicates are ignored by node
|
1543
1546
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
1544
|
-
const ignoreDuplicateOf = utils.toObjectSet([
|
1547
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
1545
1548
|
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
1546
1549
|
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
1547
1550
|
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
@@ -1602,7 +1605,7 @@ function normalizeValue(value) {
|
|
1602
1605
|
return value;
|
1603
1606
|
}
|
1604
1607
|
|
1605
|
-
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
1608
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
1606
1609
|
}
|
1607
1610
|
|
1608
1611
|
function parseTokens(str) {
|
@@ -1620,7 +1623,7 @@ function parseTokens(str) {
|
|
1620
1623
|
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
1621
1624
|
|
1622
1625
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
1623
|
-
if (utils.isFunction(filter)) {
|
1626
|
+
if (utils$1.isFunction(filter)) {
|
1624
1627
|
return filter.call(this, value, header);
|
1625
1628
|
}
|
1626
1629
|
|
@@ -1628,13 +1631,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
1628
1631
|
value = header;
|
1629
1632
|
}
|
1630
1633
|
|
1631
|
-
if (!utils.isString(value)) return;
|
1634
|
+
if (!utils$1.isString(value)) return;
|
1632
1635
|
|
1633
|
-
if (utils.isString(filter)) {
|
1636
|
+
if (utils$1.isString(filter)) {
|
1634
1637
|
return value.indexOf(filter) !== -1;
|
1635
1638
|
}
|
1636
1639
|
|
1637
|
-
if (utils.isRegExp(filter)) {
|
1640
|
+
if (utils$1.isRegExp(filter)) {
|
1638
1641
|
return filter.test(value);
|
1639
1642
|
}
|
1640
1643
|
}
|
@@ -1647,7 +1650,7 @@ function formatHeader(header) {
|
|
1647
1650
|
}
|
1648
1651
|
|
1649
1652
|
function buildAccessors(obj, header) {
|
1650
|
-
const accessorName = utils.toCamelCase(' ' + header);
|
1653
|
+
const accessorName = utils$1.toCamelCase(' ' + header);
|
1651
1654
|
|
1652
1655
|
['get', 'set', 'has'].forEach(methodName => {
|
1653
1656
|
Object.defineProperty(obj, methodName + accessorName, {
|
@@ -1674,7 +1677,7 @@ class AxiosHeaders {
|
|
1674
1677
|
throw new Error('header name must be a non-empty string');
|
1675
1678
|
}
|
1676
1679
|
|
1677
|
-
const key = utils.findKey(self, lHeader);
|
1680
|
+
const key = utils$1.findKey(self, lHeader);
|
1678
1681
|
|
1679
1682
|
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
1680
1683
|
self[key || _header] = normalizeValue(_value);
|
@@ -1682,11 +1685,11 @@ class AxiosHeaders {
|
|
1682
1685
|
}
|
1683
1686
|
|
1684
1687
|
const setHeaders = (headers, _rewrite) =>
|
1685
|
-
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
1688
|
+
utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
1686
1689
|
|
1687
|
-
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
1690
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
1688
1691
|
setHeaders(header, valueOrRewrite);
|
1689
|
-
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
1692
|
+
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
1690
1693
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
1691
1694
|
} else {
|
1692
1695
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
@@ -1699,7 +1702,7 @@ class AxiosHeaders {
|
|
1699
1702
|
header = normalizeHeader(header);
|
1700
1703
|
|
1701
1704
|
if (header) {
|
1702
|
-
const key = utils.findKey(this, header);
|
1705
|
+
const key = utils$1.findKey(this, header);
|
1703
1706
|
|
1704
1707
|
if (key) {
|
1705
1708
|
const value = this[key];
|
@@ -1712,11 +1715,11 @@ class AxiosHeaders {
|
|
1712
1715
|
return parseTokens(value);
|
1713
1716
|
}
|
1714
1717
|
|
1715
|
-
if (utils.isFunction(parser)) {
|
1718
|
+
if (utils$1.isFunction(parser)) {
|
1716
1719
|
return parser.call(this, value, key);
|
1717
1720
|
}
|
1718
1721
|
|
1719
|
-
if (utils.isRegExp(parser)) {
|
1722
|
+
if (utils$1.isRegExp(parser)) {
|
1720
1723
|
return parser.exec(value);
|
1721
1724
|
}
|
1722
1725
|
|
@@ -1729,7 +1732,7 @@ class AxiosHeaders {
|
|
1729
1732
|
header = normalizeHeader(header);
|
1730
1733
|
|
1731
1734
|
if (header) {
|
1732
|
-
const key = utils.findKey(this, header);
|
1735
|
+
const key = utils$1.findKey(this, header);
|
1733
1736
|
|
1734
1737
|
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
1735
1738
|
}
|
@@ -1745,7 +1748,7 @@ class AxiosHeaders {
|
|
1745
1748
|
_header = normalizeHeader(_header);
|
1746
1749
|
|
1747
1750
|
if (_header) {
|
1748
|
-
const key = utils.findKey(self, _header);
|
1751
|
+
const key = utils$1.findKey(self, _header);
|
1749
1752
|
|
1750
1753
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
1751
1754
|
delete self[key];
|
@@ -1755,7 +1758,7 @@ class AxiosHeaders {
|
|
1755
1758
|
}
|
1756
1759
|
}
|
1757
1760
|
|
1758
|
-
if (utils.isArray(header)) {
|
1761
|
+
if (utils$1.isArray(header)) {
|
1759
1762
|
header.forEach(deleteHeader);
|
1760
1763
|
} else {
|
1761
1764
|
deleteHeader(header);
|
@@ -1784,8 +1787,8 @@ class AxiosHeaders {
|
|
1784
1787
|
const self = this;
|
1785
1788
|
const headers = {};
|
1786
1789
|
|
1787
|
-
utils.forEach(this, (value, header) => {
|
1788
|
-
const key = utils.findKey(headers, header);
|
1790
|
+
utils$1.forEach(this, (value, header) => {
|
1791
|
+
const key = utils$1.findKey(headers, header);
|
1789
1792
|
|
1790
1793
|
if (key) {
|
1791
1794
|
self[key] = normalizeValue(value);
|
@@ -1814,8 +1817,8 @@ class AxiosHeaders {
|
|
1814
1817
|
toJSON(asStrings) {
|
1815
1818
|
const obj = Object.create(null);
|
1816
1819
|
|
1817
|
-
utils.forEach(this, (value, header) => {
|
1818
|
-
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
1820
|
+
utils$1.forEach(this, (value, header) => {
|
1821
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
1819
1822
|
});
|
1820
1823
|
|
1821
1824
|
return obj;
|
@@ -1862,7 +1865,7 @@ class AxiosHeaders {
|
|
1862
1865
|
}
|
1863
1866
|
}
|
1864
1867
|
|
1865
|
-
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
1868
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
1866
1869
|
|
1867
1870
|
return this;
|
1868
1871
|
}
|
@@ -1871,7 +1874,7 @@ class AxiosHeaders {
|
|
1871
1874
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
1872
1875
|
|
1873
1876
|
// reserved names hotfix
|
1874
|
-
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
1877
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
1875
1878
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
1876
1879
|
return {
|
1877
1880
|
get: () => value,
|
@@ -1881,7 +1884,7 @@ utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
1881
1884
|
}
|
1882
1885
|
});
|
1883
1886
|
|
1884
|
-
utils.freezeMethods(AxiosHeaders);
|
1887
|
+
utils$1.freezeMethods(AxiosHeaders);
|
1885
1888
|
|
1886
1889
|
var AxiosHeaders$1 = AxiosHeaders;
|
1887
1890
|
|
@@ -1899,7 +1902,7 @@ function transformData(fns, response) {
|
|
1899
1902
|
const headers = AxiosHeaders$1.from(context.headers);
|
1900
1903
|
let data = context.data;
|
1901
1904
|
|
1902
|
-
utils.forEach(fns, function transform(fn) {
|
1905
|
+
utils$1.forEach(fns, function transform(fn) {
|
1903
1906
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
1904
1907
|
});
|
1905
1908
|
|
@@ -1927,7 +1930,7 @@ function CanceledError(message, config, request) {
|
|
1927
1930
|
this.name = 'CanceledError';
|
1928
1931
|
}
|
1929
1932
|
|
1930
|
-
utils.inherits(CanceledError, AxiosError, {
|
1933
|
+
utils$1.inherits(CanceledError, AxiosError, {
|
1931
1934
|
__CANCEL__: true
|
1932
1935
|
});
|
1933
1936
|
|
@@ -1955,53 +1958,44 @@ function settle(resolve, reject, response) {
|
|
1955
1958
|
}
|
1956
1959
|
}
|
1957
1960
|
|
1958
|
-
var cookies = platform.
|
1961
|
+
var cookies = platform.hasStandardBrowserEnv ?
|
1959
1962
|
|
1960
|
-
// Standard browser envs support document.cookie
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
const cookie = [];
|
1965
|
-
cookie.push(name + '=' + encodeURIComponent(value));
|
1963
|
+
// Standard browser envs support document.cookie
|
1964
|
+
{
|
1965
|
+
write(name, value, expires, path, domain, secure) {
|
1966
|
+
const cookie = [name + '=' + encodeURIComponent(value)];
|
1966
1967
|
|
1967
|
-
|
1968
|
-
cookie.push('expires=' + new Date(expires).toGMTString());
|
1969
|
-
}
|
1968
|
+
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
1970
1969
|
|
1971
|
-
|
1972
|
-
cookie.push('path=' + path);
|
1973
|
-
}
|
1970
|
+
utils$1.isString(path) && cookie.push('path=' + path);
|
1974
1971
|
|
1975
|
-
|
1976
|
-
cookie.push('domain=' + domain);
|
1977
|
-
}
|
1972
|
+
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
1978
1973
|
|
1979
|
-
|
1980
|
-
cookie.push('secure');
|
1981
|
-
}
|
1974
|
+
secure === true && cookie.push('secure');
|
1982
1975
|
|
1983
|
-
|
1984
|
-
|
1976
|
+
document.cookie = cookie.join('; ');
|
1977
|
+
},
|
1985
1978
|
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1979
|
+
read(name) {
|
1980
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
1981
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
1982
|
+
},
|
1990
1983
|
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
})() :
|
1984
|
+
remove(name) {
|
1985
|
+
this.write(name, '', Date.now() - 86400000);
|
1986
|
+
}
|
1987
|
+
}
|
1996
1988
|
|
1997
|
-
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
1989
|
+
:
|
1990
|
+
|
1991
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
1992
|
+
{
|
1993
|
+
write() {},
|
1994
|
+
read() {
|
1995
|
+
return null;
|
1996
|
+
},
|
1997
|
+
remove() {}
|
1998
|
+
};
|
2005
1999
|
|
2006
2000
|
/**
|
2007
2001
|
* Determines whether the specified URL is absolute
|
@@ -2048,7 +2042,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
2048
2042
|
return requestedURL;
|
2049
2043
|
}
|
2050
2044
|
|
2051
|
-
var isURLSameOrigin = platform.
|
2045
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
2052
2046
|
|
2053
2047
|
// Standard browser envs have full support of the APIs needed to test
|
2054
2048
|
// whether the request URL is of the same origin as current location.
|
@@ -2058,7 +2052,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
2058
2052
|
let originURL;
|
2059
2053
|
|
2060
2054
|
/**
|
2061
|
-
* Parse a URL to discover
|
2055
|
+
* Parse a URL to discover its components
|
2062
2056
|
*
|
2063
2057
|
* @param {String} url The URL to be parsed
|
2064
2058
|
* @returns {Object}
|
@@ -2098,7 +2092,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
2098
2092
|
* @returns {boolean} True if URL shares the same origin, otherwise false
|
2099
2093
|
*/
|
2100
2094
|
return function isURLSameOrigin(requestURL) {
|
2101
|
-
const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
2095
|
+
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
2102
2096
|
return (parsed.protocol === originURL.protocol &&
|
2103
2097
|
parsed.host === originURL.host);
|
2104
2098
|
};
|
@@ -2203,7 +2197,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2203
2197
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
2204
2198
|
let requestData = config.data;
|
2205
2199
|
const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
|
2206
|
-
|
2200
|
+
let {responseType, withXSRFToken} = config;
|
2207
2201
|
let onCanceled;
|
2208
2202
|
function done() {
|
2209
2203
|
if (config.cancelToken) {
|
@@ -2217,14 +2211,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2217
2211
|
|
2218
2212
|
let contentType;
|
2219
2213
|
|
2220
|
-
if (utils.isFormData(requestData)) {
|
2221
|
-
if (platform.
|
2214
|
+
if (utils$1.isFormData(requestData)) {
|
2215
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
2222
2216
|
requestHeaders.setContentType(false); // Let the browser set it
|
2223
|
-
} else if(
|
2224
|
-
requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
|
2225
|
-
} else if(utils.isString(contentType = requestHeaders.getContentType())){
|
2217
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
2226
2218
|
// fix semicolon duplication issue for ReactNative FormData implementation
|
2227
|
-
|
2219
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
2220
|
+
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
2228
2221
|
}
|
2229
2222
|
}
|
2230
2223
|
|
@@ -2340,13 +2333,16 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2340
2333
|
// Add xsrf header
|
2341
2334
|
// This is only done if running in a standard browser environment.
|
2342
2335
|
// Specifically not if we're in a web worker, or react-native.
|
2343
|
-
if
|
2344
|
-
|
2345
|
-
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
|
2346
|
-
const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2336
|
+
if(platform.hasStandardBrowserEnv) {
|
2337
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
2347
2338
|
|
2348
|
-
if (
|
2349
|
-
|
2339
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
2340
|
+
// Add xsrf header
|
2341
|
+
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2342
|
+
|
2343
|
+
if (xsrfValue) {
|
2344
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
2345
|
+
}
|
2350
2346
|
}
|
2351
2347
|
}
|
2352
2348
|
|
@@ -2355,13 +2351,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2355
2351
|
|
2356
2352
|
// Add headers to the request
|
2357
2353
|
if ('setRequestHeader' in request) {
|
2358
|
-
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2354
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2359
2355
|
request.setRequestHeader(key, val);
|
2360
2356
|
});
|
2361
2357
|
}
|
2362
2358
|
|
2363
2359
|
// Add withCredentials to request if needed
|
2364
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
2360
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
2365
2361
|
request.withCredentials = !!config.withCredentials;
|
2366
2362
|
}
|
2367
2363
|
|
@@ -2416,7 +2412,7 @@ const knownAdapters = {
|
|
2416
2412
|
xhr: xhrAdapter
|
2417
2413
|
};
|
2418
2414
|
|
2419
|
-
utils.forEach(knownAdapters, (fn, value) => {
|
2415
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
2420
2416
|
if (fn) {
|
2421
2417
|
try {
|
2422
2418
|
Object.defineProperty(fn, 'name', {value});
|
@@ -2429,11 +2425,11 @@ utils.forEach(knownAdapters, (fn, value) => {
|
|
2429
2425
|
|
2430
2426
|
const renderReason = (reason) => `- ${reason}`;
|
2431
2427
|
|
2432
|
-
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
|
2428
|
+
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
2433
2429
|
|
2434
2430
|
var adapters = {
|
2435
2431
|
getAdapter: (adapters) => {
|
2436
|
-
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
2432
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
2437
2433
|
|
2438
2434
|
const {length} = adapters;
|
2439
2435
|
let nameOrAdapter;
|
@@ -2574,11 +2570,11 @@ function mergeConfig(config1, config2) {
|
|
2574
2570
|
const config = {};
|
2575
2571
|
|
2576
2572
|
function getMergedValue(target, source, caseless) {
|
2577
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
2578
|
-
return utils.merge.call({caseless}, target, source);
|
2579
|
-
} else if (utils.isPlainObject(source)) {
|
2580
|
-
return utils.merge({}, source);
|
2581
|
-
} else if (utils.isArray(source)) {
|
2573
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
2574
|
+
return utils$1.merge.call({caseless}, target, source);
|
2575
|
+
} else if (utils$1.isPlainObject(source)) {
|
2576
|
+
return utils$1.merge({}, source);
|
2577
|
+
} else if (utils$1.isArray(source)) {
|
2582
2578
|
return source.slice();
|
2583
2579
|
}
|
2584
2580
|
return source;
|
@@ -2586,25 +2582,25 @@ function mergeConfig(config1, config2) {
|
|
2586
2582
|
|
2587
2583
|
// eslint-disable-next-line consistent-return
|
2588
2584
|
function mergeDeepProperties(a, b, caseless) {
|
2589
|
-
if (!utils.isUndefined(b)) {
|
2585
|
+
if (!utils$1.isUndefined(b)) {
|
2590
2586
|
return getMergedValue(a, b, caseless);
|
2591
|
-
} else if (!utils.isUndefined(a)) {
|
2587
|
+
} else if (!utils$1.isUndefined(a)) {
|
2592
2588
|
return getMergedValue(undefined, a, caseless);
|
2593
2589
|
}
|
2594
2590
|
}
|
2595
2591
|
|
2596
2592
|
// eslint-disable-next-line consistent-return
|
2597
2593
|
function valueFromConfig2(a, b) {
|
2598
|
-
if (!utils.isUndefined(b)) {
|
2594
|
+
if (!utils$1.isUndefined(b)) {
|
2599
2595
|
return getMergedValue(undefined, b);
|
2600
2596
|
}
|
2601
2597
|
}
|
2602
2598
|
|
2603
2599
|
// eslint-disable-next-line consistent-return
|
2604
2600
|
function defaultToConfig2(a, b) {
|
2605
|
-
if (!utils.isUndefined(b)) {
|
2601
|
+
if (!utils$1.isUndefined(b)) {
|
2606
2602
|
return getMergedValue(undefined, b);
|
2607
|
-
} else if (!utils.isUndefined(a)) {
|
2603
|
+
} else if (!utils$1.isUndefined(a)) {
|
2608
2604
|
return getMergedValue(undefined, a);
|
2609
2605
|
}
|
2610
2606
|
}
|
@@ -2629,6 +2625,7 @@ function mergeConfig(config1, config2) {
|
|
2629
2625
|
timeout: defaultToConfig2,
|
2630
2626
|
timeoutMessage: defaultToConfig2,
|
2631
2627
|
withCredentials: defaultToConfig2,
|
2628
|
+
withXSRFToken: defaultToConfig2,
|
2632
2629
|
adapter: defaultToConfig2,
|
2633
2630
|
responseType: defaultToConfig2,
|
2634
2631
|
xsrfCookieName: defaultToConfig2,
|
@@ -2649,16 +2646,16 @@ function mergeConfig(config1, config2) {
|
|
2649
2646
|
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
2650
2647
|
};
|
2651
2648
|
|
2652
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2649
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2653
2650
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
2654
2651
|
const configValue = merge(config1[prop], config2[prop], prop);
|
2655
|
-
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
2652
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
2656
2653
|
});
|
2657
2654
|
|
2658
2655
|
return config;
|
2659
2656
|
}
|
2660
2657
|
|
2661
|
-
const VERSION = "1.6.
|
2658
|
+
const VERSION = "1.6.2";
|
2662
2659
|
|
2663
2660
|
const validators$1 = {};
|
2664
2661
|
|
@@ -2796,7 +2793,7 @@ class Axios {
|
|
2796
2793
|
}
|
2797
2794
|
|
2798
2795
|
if (paramsSerializer != null) {
|
2799
|
-
if (utils.isFunction(paramsSerializer)) {
|
2796
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
2800
2797
|
config.paramsSerializer = {
|
2801
2798
|
serialize: paramsSerializer
|
2802
2799
|
};
|
@@ -2812,12 +2809,12 @@ class Axios {
|
|
2812
2809
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
2813
2810
|
|
2814
2811
|
// Flatten headers
|
2815
|
-
let contextHeaders = headers && utils.merge(
|
2812
|
+
let contextHeaders = headers && utils$1.merge(
|
2816
2813
|
headers.common,
|
2817
2814
|
headers[config.method]
|
2818
2815
|
);
|
2819
2816
|
|
2820
|
-
headers && utils.forEach(
|
2817
|
+
headers && utils$1.forEach(
|
2821
2818
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
2822
2819
|
(method) => {
|
2823
2820
|
delete headers[method];
|
@@ -2904,7 +2901,7 @@ class Axios {
|
|
2904
2901
|
}
|
2905
2902
|
|
2906
2903
|
// Provide aliases for supported request methods
|
2907
|
-
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
2904
|
+
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
2908
2905
|
/*eslint func-names:0*/
|
2909
2906
|
Axios.prototype[method] = function(url, config) {
|
2910
2907
|
return this.request(mergeConfig(config || {}, {
|
@@ -2915,7 +2912,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
|
|
2915
2912
|
};
|
2916
2913
|
});
|
2917
2914
|
|
2918
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
2915
|
+
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
2919
2916
|
/*eslint func-names:0*/
|
2920
2917
|
|
2921
2918
|
function generateHTTPMethod(isForm) {
|
@@ -3091,7 +3088,7 @@ function spread(callback) {
|
|
3091
3088
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
3092
3089
|
*/
|
3093
3090
|
function isAxiosError(payload) {
|
3094
|
-
return utils.isObject(payload) && (payload.isAxiosError === true);
|
3091
|
+
return utils$1.isObject(payload) && (payload.isAxiosError === true);
|
3095
3092
|
}
|
3096
3093
|
|
3097
3094
|
const HttpStatusCode = {
|
@@ -3178,10 +3175,10 @@ function createInstance(defaultConfig) {
|
|
3178
3175
|
const instance = bind(Axios$1.prototype.request, context);
|
3179
3176
|
|
3180
3177
|
// Copy axios.prototype to instance
|
3181
|
-
utils.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
3178
|
+
utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
3182
3179
|
|
3183
3180
|
// Copy context to instance
|
3184
|
-
utils.extend(instance, context, null, {allOwnKeys: true});
|
3181
|
+
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
3185
3182
|
|
3186
3183
|
// Factory for creating new instances
|
3187
3184
|
instance.create = function create(instanceConfig) {
|
@@ -3225,7 +3222,7 @@ axios.mergeConfig = mergeConfig;
|
|
3225
3222
|
|
3226
3223
|
axios.AxiosHeaders = AxiosHeaders$1;
|
3227
3224
|
|
3228
|
-
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3225
|
+
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3229
3226
|
|
3230
3227
|
axios.getAdapter = adapters.getAdapter;
|
3231
3228
|
|