Skip to content

Commit c500a3d

Browse files
authored
Added default user-agent (#16)
Shopify doesn't accept a CURL without `CURLOPT_USERAGENT` option, it returns `403 Forbidden` instead.
1 parent abcaa62 commit c500a3d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Feed.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ private static function httpRequest($url, $user, $pass)
218218
curl_setopt($curl, CURLOPT_TIMEOUT, 20);
219219
curl_setopt($curl, CURLOPT_ENCODING, '');
220220
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // no echo, just return result
221+
curl_setopt($curl, CURLOPT_USERAGENT, '');
221222
if (!ini_get('open_basedir')) {
222223
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); // sometime is useful :)
223224
}

0 commit comments

Comments
 (0)