Skip to content

Commit

Permalink
Unzip response body only for statuses != 204 (#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
drawski authored and emilyemorehouse committed May 15, 2019
1 parent 92d2313 commit fd0c959
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/adapters/http.js
Expand Up @@ -188,7 +188,7 @@ module.exports = function httpAdapter(config) {
case 'compress':
case 'deflate':
// add the unzipper to the body stream processing pipeline
stream = stream.pipe(zlib.createUnzip());
stream = (res.statusCode === 204) ? stream : stream.pipe(zlib.createUnzip());

// remove the content-encoding in order to not confuse downstream operations
delete res.headers['content-encoding'];
Expand Down

0 comments on commit fd0c959

Please sign in to comment.