Skip to content
Permalink
Browse files

Unzip response body only for statuses != 204 (#1129)

  • Loading branch information
drawski authored and emilyemorehouse committed May 15, 2019
1 parent 92d2313 commit fd0c959355e85afa76d1728b7c7bd93a05e004a4
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/adapters/http.js
@@ -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'];

0 comments on commit fd0c959

Please sign in to comment.
You can’t perform that action at this time.