Made it cope with gzip encoded content

This commit is contained in:
pezcurrel 2022-12-15 12:45:52 +01:00
parent 3a720a90ac
commit 8cf8c416ed

View file

@ -16,6 +16,8 @@ function getfc($url,$timeout,$headers=[]) {
$headers_sz=curl_getinfo($curli,CURLINFO_HEADER_SIZE);
$headers=substr($cont,0,$headers_sz);
$cont=substr($cont,$headers_sz);
if (preg_match('/^Content-Encoding: gzip/m',$headers)===1)
$cont=gzdecode($cont);
$emsg=false;
$cerrno=curl_errno($curli);
if ($cerrno>0) {