axios 1.3.4 → 1.3.6

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/dist/esm/axios.js CHANGED
@@ -1,4 +1,4 @@
1
- // Axios v1.3.4 Copyright (c) 2023 Matt Zabriskie and contributors
1
+ // Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
2
2
  function bind(fn, thisArg) {
3
3
  return function wrap() {
4
4
  return fn.apply(thisArg, arguments);
@@ -191,12 +191,16 @@ const isStream = (val) => isObject(val) && isFunction(val.pipe);
191
191
  * @returns {boolean} True if value is an FormData, otherwise false
192
192
  */
193
193
  const isFormData = (thing) => {
194
- const pattern = '[object FormData]';
194
+ let kind;
195
195
  return thing && (
196
- (typeof FormData === 'function' && thing instanceof FormData) ||
197
- toString.call(thing) === pattern ||
198
- (isFunction(thing.toString) && thing.toString() === pattern)
199
- );
196
+ (typeof FormData === 'function' && thing instanceof FormData) || (
197
+ isFunction(thing.append) && (
198
+ (kind = kindOf(thing)) === 'formdata' ||
199
+ // detect form-data instance
200
+ (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
201
+ )
202
+ )
203
+ )
200
204
  };
201
205
 
202
206
  /**
@@ -1610,9 +1614,7 @@ function parseTokens(str) {
1610
1614
  return tokens;
1611
1615
  }
1612
1616
 
1613
- function isValidHeaderName(str) {
1614
- return /^[-_a-zA-Z]+$/.test(str.trim());
1615
- }
1617
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1616
1618
 
1617
1619
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1618
1620
  if (utils.isFunction(filter)) {
@@ -2616,7 +2618,7 @@ function mergeConfig$1(config1, config2) {
2616
2618
  return config;
2617
2619
  }
2618
2620
 
2619
- const VERSION$1 = "1.3.4";
2621
+ const VERSION$1 = "1.3.6";
2620
2622
 
2621
2623
  const validators$1 = {};
2622
2624
 
@@ -2753,11 +2755,17 @@ class Axios$1 {
2753
2755
  }, false);
2754
2756
  }
2755
2757
 
2756
- if (paramsSerializer !== undefined) {
2757
- validator.assertOptions(paramsSerializer, {
2758
- encode: validators.function,
2759
- serialize: validators.function
2760
- }, true);
2758
+ if (paramsSerializer != null) {
2759
+ if (utils.isFunction(paramsSerializer)) {
2760
+ config.paramsSerializer = {
2761
+ serialize: paramsSerializer
2762
+ };
2763
+ } else {
2764
+ validator.assertOptions(paramsSerializer, {
2765
+ encode: validators.function,
2766
+ serialize: validators.function
2767
+ }, true);
2768
+ }
2761
2769
  }
2762
2770
 
2763
2771
  // Set config.method