axios 1.2.5 → 1.2.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/index.d.cts CHANGED
@@ -10,6 +10,12 @@ type MethodsHeaders = Partial<{
10
10
 
11
11
  type AxiosHeaderMatcher = (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean;
12
12
 
13
+ type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent'| 'Content-Encoding' | 'Authorization';
14
+
15
+ type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
16
+
17
+ type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
18
+
13
19
  declare class AxiosHeaders {
14
20
  constructor(
15
21
  headers?: RawAxiosHeaders | AxiosHeaders
@@ -41,7 +47,7 @@ declare class AxiosHeaders {
41
47
 
42
48
  static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
43
49
 
44
- setContentType(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
50
+ setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
45
51
  getContentType(parser?: RegExp): RegExpExecArray | null;
46
52
  getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
47
53
  hasContentType(matcher?: AxiosHeaderMatcher): boolean;
@@ -200,16 +206,14 @@ type InternalAxiosError<T = unknown, D = any> = AxiosError<T, D>;
200
206
  declare namespace axios {
201
207
  type AxiosError<T = unknown, D = any> = InternalAxiosError<T, D>;
202
208
 
203
- type CommonRequestHeadersList = 'Accept' | 'Content-Type' | 'Content-Length' | 'User-Agent'| 'Content-Encoding';
204
-
205
209
  type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
206
210
  [Key in CommonRequestHeadersList]: AxiosHeaderValue;
211
+ } & {
212
+ 'Content-Type': ContentType
207
213
  }>;
208
214
 
209
215
  type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
210
216
 
211
- type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding';
212
-
213
217
  type RawCommonResponseHeaders = {
214
218
  [Key in CommonResponseHeadersList]: AxiosHeaderValue;
215
219
  } & {
package/index.d.ts CHANGED
@@ -42,7 +42,7 @@ export class AxiosHeaders {
42
42
 
43
43
  static concat(...targets: Array<AxiosHeaders | RawAxiosHeaders | string | undefined | null>): AxiosHeaders;
44
44
 
45
- setContentType(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
45
+ setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders;
46
46
  getContentType(parser?: RegExp): RegExpExecArray | null;
47
47
  getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
48
48
  hasContentType(matcher?: AxiosHeaderMatcher): boolean;
@@ -75,10 +75,14 @@ export class AxiosHeaders {
75
75
  [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
76
76
  }
77
77
 
78
- type CommonRequestHeadersList = 'Accept' | 'Content-Type' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
78
+ type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization';
79
+
80
+ type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream';
79
81
 
80
82
  export type RawAxiosRequestHeaders = Partial<RawAxiosHeaders & {
81
83
  [Key in CommonRequestHeadersList]: AxiosHeaderValue;
84
+ } & {
85
+ 'Content-Type': ContentType
82
86
  }>;
83
87
 
84
88
  export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders;
@@ -266,7 +266,7 @@ class AxiosHeaders {
266
266
  }
267
267
  }
268
268
 
269
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']);
269
+ AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
270
270
 
271
271
  utils.freezeMethods(AxiosHeaders.prototype);
272
272
  utils.freezeMethods(AxiosHeaders);
package/lib/env/data.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.2.5";
1
+ export const VERSION = "1.2.6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -190,6 +190,13 @@
190
190
  }
191
191
  },
192
192
  "commitlint": {
193
+ "rules": {
194
+ "header-max-length": [
195
+ 2,
196
+ "always",
197
+ 130
198
+ ]
199
+ },
193
200
  "extends": [
194
201
  "@commitlint/config-conventional"
195
202
  ]