diff --git a/lib/adapters/http.js b/lib/adapters/http.js index 71bd1855ef..e5b2a542b8 100644 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -142,7 +142,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'];