Skip to content

Commit 5052177

Browse files
authored
Merge pull request #109 from Daniel-KM/fix/gunzip_body
Used gzdecode() instead of gzinflate() for better compatibility.
2 parents 3fba886 + 6b25951 commit 5052177

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Response.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use function explode;
1111
use function function_exists;
1212
use function gettype;
13+
use function gzdecode;
1314
use function gzinflate;
1415
use function gzuncompress;
1516
use function hexdec;
@@ -586,7 +587,7 @@ protected function decodeChunkedBody($body)
586587
*/
587588
protected function decodeGzip($body)
588589
{
589-
if (! function_exists('gzinflate')) {
590+
if (! function_exists('gzdecode')) {
590591
throw new Exception\RuntimeException(
591592
'zlib extension is required in order to decode "gzip" encoding'
592593
);
@@ -601,7 +602,7 @@ protected function decodeGzip($body)
601602
}
602603

603604
ErrorHandler::start();
604-
$return = gzinflate(substr($body, 10));
605+
$return = gzdecode($body);
605606
$test = ErrorHandler::stop();
606607
if ($test) {
607608
throw new Exception\RuntimeException(

0 commit comments

Comments
 (0)