httpclient : de-zip the content of the page if Content-Encoding = gzip

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4810 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2018-12-27 15:38:36 +00:00
parent b1e2f45e6a
commit d4e913d00e

View File

@@ -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))