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.

package/index.d.cts CHANGED
@@ -370,7 +370,7 @@ declare namespace axios {
370
370
  transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
371
371
  headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
372
372
  params?: any;
373
- paramsSerializer?: ParamsSerializerOptions;
373
+ paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
374
374
  data?: D;
375
375
  timeout?: Milliseconds;
376
376
  timeoutErrorMessage?: string;
package/index.d.ts CHANGED
@@ -311,7 +311,7 @@ export interface AxiosRequestConfig<D = any> {
311
311
  transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
312
312
  headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders;
313
313
  params?: any;
314
- paramsSerializer?: ParamsSerializerOptions;
314
+ paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
315
315
  data?: D;
316
316
  timeout?: Milliseconds;
317
317
  timeoutErrorMessage?: string;
package/lib/core/Axios.js CHANGED
@@ -57,11 +57,17 @@ class Axios {
57
57
  }, false);
58
58
  }
59
59
 
60
- if (paramsSerializer !== undefined) {
61
- validator.assertOptions(paramsSerializer, {
62
- encode: validators.function,
63
- serialize: validators.function
64
- }, true);
60
+ if (paramsSerializer != null) {
61
+ if (utils.isFunction(paramsSerializer)) {
62
+ config.paramsSerializer = {
63
+ serialize: paramsSerializer
64
+ }
65
+ } else {
66
+ validator.assertOptions(paramsSerializer, {
67
+ encode: validators.function,
68
+ serialize: validators.function
69
+ }, true);
70
+ }
65
71
  }
66
72
 
67
73
  // Set config.method
@@ -29,9 +29,7 @@ function parseTokens(str) {
29
29
  return tokens;
30
30
  }
31
31
 
32
- function isValidHeaderName(str) {
33
- return /^[-_a-zA-Z]+$/.test(str.trim());
34
- }
32
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
35
33
 
36
34
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
37
35
  if (utils.isFunction(filter)) {
package/lib/env/data.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.3.4";
1
+ export const VERSION = "1.3.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "exports": {