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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user