axios 1.3.4 → 1.3.5

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.3.4 Copyright (c) 2023 Matt Zabriskie and contributors
1
+ // Axios v1.3.5 Copyright (c) 2023 Matt Zabriskie and contributors
2
2
  'use strict';
3
3
 
4
4
  function bind(fn, thisArg) {
@@ -1612,9 +1612,7 @@ function parseTokens(str) {
1612
1612
  return tokens;
1613
1613
  }
1614
1614
 
1615
- function isValidHeaderName(str) {
1616
- return /^[-_a-zA-Z]+$/.test(str.trim());
1617
- }
1615
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1618
1616
 
1619
1617
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1620
1618
  if (utils.isFunction(filter)) {
@@ -2618,7 +2616,7 @@ function mergeConfig(config1, config2) {
2618
2616
  return config;
2619
2617
  }
2620
2618
 
2621
- const VERSION = "1.3.4";
2619
+ const VERSION = "1.3.5";
2622
2620
 
2623
2621
  const validators$1 = {};
2624
2622
 
@@ -2755,11 +2753,17 @@ class Axios {
2755
2753
  }, false);
2756
2754
  }
2757
2755
 
2758
- if (paramsSerializer !== undefined) {
2759
- validator.assertOptions(paramsSerializer, {
2760
- encode: validators.function,
2761
- serialize: validators.function
2762
- }, true);
2756
+ if (paramsSerializer != null) {
2757
+ if (utils.isFunction(paramsSerializer)) {
2758
+ config.paramsSerializer = {
2759
+ serialize: paramsSerializer
2760
+ };
2761
+ } else {
2762
+ validator.assertOptions(paramsSerializer, {
2763
+ encode: validators.function,
2764
+ serialize: validators.function
2765
+ }, true);
2766
+ }
2763
2767
  }
2764
2768
 
2765
2769
  // Set config.method