diff --git a/httpclient.php b/httpclient.php index 43a51b6..f6b235f 100644 --- a/httpclient.php +++ b/httpclient.php @@ -723,6 +723,12 @@ class Httpclient if (strlen ($content) > $this->maxsize) throw new \Exception ("File to get exceeded maxsize", 500); } + if (key_exists ("Content-Encoding", $this->headersReceived)) + { + if ($this->headersReceived["Content-Encoding"] === "gzip" && + function_exists ("gzdecode")) + $content = gzdecode ($content); + } $this->disconnect (); if ($this->httpCode === 301 || $this->httpCode === 302 || key_exists ("Location", $this->headersReceived))