Make Box_Tools use our custom user agent

This commit is contained in:
Yağızhan authored and GitHub committed 2021-10-25 00:07:42 +03:00
1 parent fee1edcbcc
commit 586525ec5b
1 file changed
+2 -1
+2 -1
View File
@@ -66,8 +66,9 @@ class Box_Tools
public function get_url($url, $timeout = 10)
{
// TODO: Replace with Guzzle
$ch = curl_init();
$userAgent = 'Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0';
$userAgent = $this->di['config']['guzzle']['user_agent'];
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);