mirror of
https://github.com/tenrok/axios.git
synced 2026-06-05 16:42:32 +03:00
Unzip response body only for statuses != 204 (#1129)
This commit is contained in:
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user