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
kian
kian2y ago
Are you including a User-Agent on your fetch subrequest?
DaveJ
DaveJOP2y ago
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?
Walshy
Walshy2y ago
No... You should make it whatever your site is called and include some contact preferably
kian
kian2y ago
Cloudflare-Workers/1.0 (+yourdomainifyoufeellikeit)
Walshy
Walshy2y ago
Basically a way to identify it to yourself
DaveJ
DaveJOP2y ago
ok, will try and report back
kian
kian2y ago
That might not fix it, I just vaguely remember that being an issue with an API for someone
DaveJ
DaveJOP2y ago
That worked, thank you @kiannh and @walshydev 🙏 Unrelated: is there a way to mark a question as solved?
Want results from more Discord servers?
Add your server