I need to return a page that is in text / html , but it is encoded with zlib , yes I tried to decode but no chances, http://php.net/manual/pt_BR/function.zlib-decode.php">zlib_decode , is not documented so I did searches but everything without success, see the return:
'HTTP/1.1 200 OK
Content-Type: text/html
X-Frame-Options: SAMEORIGIN
Vary: Cookie, Accept-Language, Accept-Encoding
Cache-Control: private, no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Content-Language: pt-br
Content-Encoding: gzip
Date: Wed, 03 Jan 2018 19:03:06 GMT
Strict-Transport-Security: max-age=86400
Set-Cookie: alguns cookies'... (length=5280)
And here's my request
function challenge($url) {
$getCSRF = getCSRF();
$request = curl_init();
curl_setopt_array($request, array(
CURLOPT_URL => 'https://www.url.com/' . $url,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HEADER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_COOKIE => $getCSRF->cookies,
CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],
CURLOPT_HTTPHEADER => array(
'accept-encoding:gzip, deflate, br',
'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'accept-language:pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
)
));
$response = curl_exec($request);
curl_close($request);
return $response;
}
var_dump(challenge('challenge/id/Fn0C4GsZjg/'));