Skip to content

Commit

Permalink
fix: decompress response data
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersonfelixdev committed Nov 23, 2022
1 parent f92e167 commit 95c7fbf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,12 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
if (config.decompress !== false) {
// if no content, but headers still say that it is encoded,
// remove the header not confuse downstream operations
if ((!responseLength || res.statusCode === 204) && res.headers['content-encoding']) {
delete res.headers['content-encoding'];
if (
(!responseLength || res.statusCode === 204) &&
res.headers["content-encoding"] &&
!res.headers["transport-encoding"]
) {
delete res.headers["content-encoding"];
}

switch (res.headers['content-encoding']) {
Expand Down

0 comments on commit 95c7fbf

Please sign in to comment.