From 586525ec5bef5fcc1ca73f9e26a2e8d678090ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Mon, 25 Oct 2021 00:07:42 +0300 Subject: [PATCH] Make Box_Tools use our custom user agent --- src/bb-library/Box/Tools.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bb-library/Box/Tools.php b/src/bb-library/Box/Tools.php index f7483e0d1..9d88f0d43 100644 --- a/src/bb-library/Box/Tools.php +++ b/src/bb-library/Box/Tools.php @@ -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);