Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user agent to curl to avoid 403 #2

Closed
wants to merge 1 commit into from
Closed

Conversation

ajoy39
Copy link

@ajoy39 ajoy39 commented Sep 24, 2022

Picsum, like many sites, has begun returning 403 for requests without a user agent. curl_exec doesn't set a default user agent, even if one is set in php ini, so as it stands this library can no longer download images. This PR sets the curl user agent to the value set in php.ini with a fallback to a recent version of firefox, allowing image downloads again

@smknstd
Copy link
Owner

smknstd commented Oct 11, 2022

Thanx for your PR :) I closed it without merging because it had a syntax error or something + I commited a dummy user agent directly on main branch e438bbf

please upgrade to https://github.com/smknstd/fakerphp-picsum-images/releases/tag/v1.0.2

ps: morawskim/faker-images#6

@smknstd smknstd closed this Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants