403 forbidden when querying github API from Cloudflare
I am doing a
fetch
request to get latest releases from a GitHub repo. It is working fine on my localhost machine but when I push it Cloudflare it returns a 403 error.
What could be going on?8 Replies
Are you including a User-Agent on your
fetch
subrequest?No, do I need to? It's not required when running locally.
@kiannh What is a good user-agent to use? Copy the latest Chrome UA?
No...
You should make it whatever your site is called and include some contact preferably
Cloudflare-Workers/1.0 (+yourdomainifyoufeellikeit)
Basically a way to identify it to yourself
ok, will try and report back
That might not fix it, I just vaguely remember that being an issue with an API for someone
That worked, thank you @kiannh and @walshydev 🙏
Unrelated: is there a way to mark a question as solved?