Skip to content

Commit

Permalink
Revert "chore: ensure headers are case insensitive"
Browse files Browse the repository at this point in the history
This reverts commit b768554.
  • Loading branch information
boristomic committed Dec 11, 2023
1 parent b768554 commit dd4bf82
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,8 @@ export class RequestWrapper {
}

private isJsonResponse<T extends TransformedResponse | AxiosResponse>(response: T) {
let headers: RawAxiosResponseHeaders | AxiosResponseHeaders = {};
Object.assign(headers, response.headers);
headers = Object.entries(response.headers)
.reduce((acc: RawAxiosResponseHeaders | AxiosResponseHeaders, [key, val]) => {
acc[key.toLowerCase()] = val.toLowerCase();
return acc;
}, ({}));

return headers['content-type'] &&
headers['content-type'].indexOf('application/json') !== -1;
return response.headers['content-type'] &&
response.headers['content-type'].indexOf('application/json') !== -1;
}

private getLogParameters(extraParametersToLog = {}) {
Expand Down

0 comments on commit dd4bf82

Please sign in to comment.