Skip to content

Commit

Permalink
add dummy user agent to prevent 403 from picsum
Browse files Browse the repository at this point in the history
  • Loading branch information
smknstd committed Oct 11, 2022
1 parent 0fad985 commit e438bbf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/FakerPicsumImagesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private static function fetchImage(
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0');
$success = curl_exec($ch) && curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200;
fclose($fp);
curl_close($ch);
Expand Down

0 comments on commit e438bbf

Please sign in to comment.