Skip to content

Commit 88bc071

Browse files
ANKUR DWIVEDIANKUR DWIVEDI
authored andcommitted
updated axios headers
1 parent f618325 commit 88bc071

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function request<T, E extends Error>(
3131
const { data, status, headers } = response;
3232
const responseMetadata = {
3333
statusCode: status,
34-
headers: headers instanceof AxiosHeaders ? headers.toJSON() : headers
34+
headers: (headers as AxiosHeaders).toJSON()
3535
}
3636
var result = data ? data : {} as T;
3737
// define status code and headers as non-enumerable properties on data
@@ -48,7 +48,7 @@ export default function request<T, E extends Error>(
4848
// that falls out of the range of 2xx
4949
const responseMetadata = {
5050
statusCode: error.response.status,
51-
headers: error.response.headers instanceof AxiosHeaders ? error.response.headers.toJSON() : error.response.headers
51+
headers: (error.response.headers as AxiosHeaders).toJSON()
5252
}
5353

5454
var result = {} as Object;

0 commit comments

Comments
 (0)