axios 1.6.0 → 1.6.1

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.

@@ -1,4 +1,4 @@
1
- // Axios v1.6.0 Copyright (c) 2023 Matt Zabriskie and contributors
1
+ // Axios v1.6.1 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 isStandardBrowserEnv = (() => {
1249
- let product;
1250
- if (typeof navigator !== 'undefined' && (
1251
- (product = navigator.product) === 'ReactNative' ||
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
- const isStandardBrowserWebWorkerEnv = (() => {
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
- isBrowser: true,
1282
- classes: {
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,7 +1958,7 @@ function settle(resolve, reject, response) {
1955
1958
  }
1956
1959
  }
1957
1960
 
1958
- var cookies = platform.isStandardBrowserEnv ?
1961
+ var cookies = platform.hasStandardBrowserEnv ?
1959
1962
 
1960
1963
  // Standard browser envs support document.cookie
1961
1964
  (function standardBrowserEnv() {
@@ -1964,15 +1967,15 @@ var cookies = platform.isStandardBrowserEnv ?
1964
1967
  const cookie = [];
1965
1968
  cookie.push(name + '=' + encodeURIComponent(value));
1966
1969
 
1967
- if (utils.isNumber(expires)) {
1970
+ if (utils$1.isNumber(expires)) {
1968
1971
  cookie.push('expires=' + new Date(expires).toGMTString());
1969
1972
  }
1970
1973
 
1971
- if (utils.isString(path)) {
1974
+ if (utils$1.isString(path)) {
1972
1975
  cookie.push('path=' + path);
1973
1976
  }
1974
1977
 
1975
- if (utils.isString(domain)) {
1978
+ if (utils$1.isString(domain)) {
1976
1979
  cookie.push('domain=' + domain);
1977
1980
  }
1978
1981
 
@@ -2048,7 +2051,7 @@ function buildFullPath(baseURL, requestedURL) {
2048
2051
  return requestedURL;
2049
2052
  }
2050
2053
 
2051
- var isURLSameOrigin = platform.isStandardBrowserEnv ?
2054
+ var isURLSameOrigin = platform.hasStandardBrowserEnv ?
2052
2055
 
2053
2056
  // Standard browser envs have full support of the APIs needed to test
2054
2057
  // whether the request URL is of the same origin as current location.
@@ -2098,7 +2101,7 @@ var isURLSameOrigin = platform.isStandardBrowserEnv ?
2098
2101
  * @returns {boolean} True if URL shares the same origin, otherwise false
2099
2102
  */
2100
2103
  return function isURLSameOrigin(requestURL) {
2101
- const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2104
+ const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2102
2105
  return (parsed.protocol === originURL.protocol &&
2103
2106
  parsed.host === originURL.host);
2104
2107
  };
@@ -2217,14 +2220,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2217
2220
 
2218
2221
  let contentType;
2219
2222
 
2220
- if (utils.isFormData(requestData)) {
2221
- if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
2223
+ if (utils$1.isFormData(requestData)) {
2224
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
2222
2225
  requestHeaders.setContentType(false); // Let the browser set it
2223
- } else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){
2224
- requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
2225
- } else if(utils.isString(contentType = requestHeaders.getContentType())){
2226
+ } else if ((contentType = requestHeaders.getContentType()) !== false) {
2226
2227
  // fix semicolon duplication issue for ReactNative FormData implementation
2227
- requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1'));
2228
+ const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
2229
+ requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
2228
2230
  }
2229
2231
  }
2230
2232
 
@@ -2340,7 +2342,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2340
2342
  // Add xsrf header
2341
2343
  // This is only done if running in a standard browser environment.
2342
2344
  // Specifically not if we're in a web worker, or react-native.
2343
- if (platform.isStandardBrowserEnv) {
2345
+ if (platform.hasStandardBrowserEnv) {
2344
2346
  // Add xsrf header
2345
2347
  // regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
2346
2348
  const xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
@@ -2355,13 +2357,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2355
2357
 
2356
2358
  // Add headers to the request
2357
2359
  if ('setRequestHeader' in request) {
2358
- utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2360
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2359
2361
  request.setRequestHeader(key, val);
2360
2362
  });
2361
2363
  }
2362
2364
 
2363
2365
  // Add withCredentials to request if needed
2364
- if (!utils.isUndefined(config.withCredentials)) {
2366
+ if (!utils$1.isUndefined(config.withCredentials)) {
2365
2367
  request.withCredentials = !!config.withCredentials;
2366
2368
  }
2367
2369
 
@@ -2416,7 +2418,7 @@ const knownAdapters = {
2416
2418
  xhr: xhrAdapter
2417
2419
  };
2418
2420
 
2419
- utils.forEach(knownAdapters, (fn, value) => {
2421
+ utils$1.forEach(knownAdapters, (fn, value) => {
2420
2422
  if (fn) {
2421
2423
  try {
2422
2424
  Object.defineProperty(fn, 'name', {value});
@@ -2429,11 +2431,11 @@ utils.forEach(knownAdapters, (fn, value) => {
2429
2431
 
2430
2432
  const renderReason = (reason) => `- ${reason}`;
2431
2433
 
2432
- const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
2434
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
2433
2435
 
2434
2436
  var adapters = {
2435
2437
  getAdapter: (adapters) => {
2436
- adapters = utils.isArray(adapters) ? adapters : [adapters];
2438
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
2437
2439
 
2438
2440
  const {length} = adapters;
2439
2441
  let nameOrAdapter;
@@ -2574,11 +2576,11 @@ function mergeConfig(config1, config2) {
2574
2576
  const config = {};
2575
2577
 
2576
2578
  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)) {
2579
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2580
+ return utils$1.merge.call({caseless}, target, source);
2581
+ } else if (utils$1.isPlainObject(source)) {
2582
+ return utils$1.merge({}, source);
2583
+ } else if (utils$1.isArray(source)) {
2582
2584
  return source.slice();
2583
2585
  }
2584
2586
  return source;
@@ -2586,25 +2588,25 @@ function mergeConfig(config1, config2) {
2586
2588
 
2587
2589
  // eslint-disable-next-line consistent-return
2588
2590
  function mergeDeepProperties(a, b, caseless) {
2589
- if (!utils.isUndefined(b)) {
2591
+ if (!utils$1.isUndefined(b)) {
2590
2592
  return getMergedValue(a, b, caseless);
2591
- } else if (!utils.isUndefined(a)) {
2593
+ } else if (!utils$1.isUndefined(a)) {
2592
2594
  return getMergedValue(undefined, a, caseless);
2593
2595
  }
2594
2596
  }
2595
2597
 
2596
2598
  // eslint-disable-next-line consistent-return
2597
2599
  function valueFromConfig2(a, b) {
2598
- if (!utils.isUndefined(b)) {
2600
+ if (!utils$1.isUndefined(b)) {
2599
2601
  return getMergedValue(undefined, b);
2600
2602
  }
2601
2603
  }
2602
2604
 
2603
2605
  // eslint-disable-next-line consistent-return
2604
2606
  function defaultToConfig2(a, b) {
2605
- if (!utils.isUndefined(b)) {
2607
+ if (!utils$1.isUndefined(b)) {
2606
2608
  return getMergedValue(undefined, b);
2607
- } else if (!utils.isUndefined(a)) {
2609
+ } else if (!utils$1.isUndefined(a)) {
2608
2610
  return getMergedValue(undefined, a);
2609
2611
  }
2610
2612
  }
@@ -2649,16 +2651,16 @@ function mergeConfig(config1, config2) {
2649
2651
  headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2650
2652
  };
2651
2653
 
2652
- utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2654
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2653
2655
  const merge = mergeMap[prop] || mergeDeepProperties;
2654
2656
  const configValue = merge(config1[prop], config2[prop], prop);
2655
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2657
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2656
2658
  });
2657
2659
 
2658
2660
  return config;
2659
2661
  }
2660
2662
 
2661
- const VERSION = "1.6.0";
2663
+ const VERSION = "1.6.1";
2662
2664
 
2663
2665
  const validators$1 = {};
2664
2666
 
@@ -2796,7 +2798,7 @@ class Axios {
2796
2798
  }
2797
2799
 
2798
2800
  if (paramsSerializer != null) {
2799
- if (utils.isFunction(paramsSerializer)) {
2801
+ if (utils$1.isFunction(paramsSerializer)) {
2800
2802
  config.paramsSerializer = {
2801
2803
  serialize: paramsSerializer
2802
2804
  };
@@ -2812,12 +2814,12 @@ class Axios {
2812
2814
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
2813
2815
 
2814
2816
  // Flatten headers
2815
- let contextHeaders = headers && utils.merge(
2817
+ let contextHeaders = headers && utils$1.merge(
2816
2818
  headers.common,
2817
2819
  headers[config.method]
2818
2820
  );
2819
2821
 
2820
- headers && utils.forEach(
2822
+ headers && utils$1.forEach(
2821
2823
  ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
2822
2824
  (method) => {
2823
2825
  delete headers[method];
@@ -2904,7 +2906,7 @@ class Axios {
2904
2906
  }
2905
2907
 
2906
2908
  // Provide aliases for supported request methods
2907
- utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
2909
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
2908
2910
  /*eslint func-names:0*/
2909
2911
  Axios.prototype[method] = function(url, config) {
2910
2912
  return this.request(mergeConfig(config || {}, {
@@ -2915,7 +2917,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
2915
2917
  };
2916
2918
  });
2917
2919
 
2918
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
2920
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
2919
2921
  /*eslint func-names:0*/
2920
2922
 
2921
2923
  function generateHTTPMethod(isForm) {
@@ -3091,7 +3093,7 @@ function spread(callback) {
3091
3093
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3092
3094
  */
3093
3095
  function isAxiosError(payload) {
3094
- return utils.isObject(payload) && (payload.isAxiosError === true);
3096
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
3095
3097
  }
3096
3098
 
3097
3099
  const HttpStatusCode = {
@@ -3178,10 +3180,10 @@ function createInstance(defaultConfig) {
3178
3180
  const instance = bind(Axios$1.prototype.request, context);
3179
3181
 
3180
3182
  // Copy axios.prototype to instance
3181
- utils.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
3183
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
3182
3184
 
3183
3185
  // Copy context to instance
3184
- utils.extend(instance, context, null, {allOwnKeys: true});
3186
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
3185
3187
 
3186
3188
  // Factory for creating new instances
3187
3189
  instance.create = function create(instanceConfig) {
@@ -3225,7 +3227,7 @@ axios.mergeConfig = mergeConfig;
3225
3227
 
3226
3228
  axios.AxiosHeaders = AxiosHeaders$1;
3227
3229
 
3228
- axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
3230
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
3229
3231
 
3230
3232
  axios.getAdapter = adapters.getAdapter;
3231
3233