You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Some sites returns 403 with the default user-agent
86
+
if ($response->getStatusCode() === 403) {
87
+
$options[CURLOPT_USERAGENT] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36';
88
+
89
+
return$this->exec($url, $options);
86
90
}
87
91
92
+
return$response;
93
+
}
94
+
95
+
/**
96
+
* Execute a curl request
97
+
*
98
+
* @param Url $url
99
+
* @param array $options
100
+
*
101
+
* @return Response
102
+
*/
103
+
protectedfunctionexec(Url$url, array$options)
104
+
{
105
+
$connection = curl_init((string) $url);
106
+
curl_setopt_array($connection, $options);
107
+
88
108
$curl = newCurlResult($connection);
89
109
90
110
//Get only text responses
@@ -115,6 +135,7 @@ public function dispatch(Url $url)
0 commit comments