php-multi-curl icon indicating copy to clipboard operation
php-multi-curl copied to clipboard

Issue with SSL when passing a user agent

Open itdoell opened this issue 12 years ago • 1 comments

Depending on which site you're trying to access, the script is goes into an infinite loop infinite loop. The Google homepage is one of the sites breaking.

$mc = EpiCurl::getInstance();
$url = 'https://www.google.com';
$ch = curl_init($url);
$options = array(
          CURLOPT_USERAGENT => "Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0",
          CURLOPT_RETURNTRANSFER => true,
          CURLOPT_HEADER => false
        );
curl_setopt_array($ch, $options);
echo $mc->addCurl($ch)->data;

If I try to run that it goes into an infinite loop. If the user agent is removed, it will return the result. Also works as expected when not using EpiCurl for multi curl. I cannot seem to figure out what is causing this issue.

itdoell avatar Jan 17 '13 03:01 itdoell

Would need to look at the response and response headers to see what Google does different with that UA. Not sure why that would cause a problem with this library but worth looking into.

jmathai avatar Oct 19 '15 17:10 jmathai