diff --git a/library/Requests.php b/library/Requests.php index 997bfa84e..731db0288 100644 --- a/library/Requests.php +++ b/library/Requests.php @@ -677,7 +677,10 @@ protected static function parse_response($headers, $url, $req_headers, $req_data unset($return->headers['transfer-encoding']); } if (isset($return->headers['content-encoding'])) { - $return->body = self::decompress($return->body); + $compressed_encoding = array_intersect(explode(',', strtolower($return->headers['content-encoding'])), array('gzip', 'x-gzip', 'deflate', 'compress', 'x-compress')); + if (!empty($compressed_encoding)) { + $return->body = self::decompress($return->body); + } } //fsockopen and cURL compatibility