From aa9187461363fe56c65932f38677179b5a4e5dd2 Mon Sep 17 00:00:00 2001 From: Ignacio Catalina Date: Wed, 3 Nov 2021 13:53:54 +1100 Subject: [PATCH] fix(curl): Add CURLOPT_USERAGENT to all requests User agent is no longer present when making the requests, this causes some of them to fail --- src/Bigcommerce/Api/Connection.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bigcommerce/Api/Connection.php b/src/Bigcommerce/Api/Connection.php index ade9a7e..c333d67 100644 --- a/src/Bigcommerce/Api/Connection.php +++ b/src/Bigcommerce/Api/Connection.php @@ -97,6 +97,7 @@ public function __construct() $this->curl = curl_init(); curl_setopt($this->curl, CURLOPT_HEADERFUNCTION, [$this, 'parseHeader']); curl_setopt($this->curl, CURLOPT_WRITEFUNCTION, [$this, 'parseBody']); + curl_setopt($this->curl, CURLOPT_USERAGENT, 'PHP CURL - Bigcommerce API Client'); // Set to a blank string to make cURL include all encodings it can handle (gzip, deflate, identity) in the 'Accept-Encoding' request header and respect the 'Content-Encoding' response header curl_setopt($this->curl, CURLOPT_ENCODING, '');