Skip to content

Commit

Permalink
fix(curl): Add CURLOPT_USERAGENT to all requests
Browse files Browse the repository at this point in the history
User agent is no longer present when making the requests, this causes some
of them to fail
  • Loading branch information
icatalina committed Nov 3, 2021
1 parent 7750e08 commit aa91874
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Bigcommerce/Api/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '');
Expand Down

0 comments on commit aa91874

Please sign in to comment.