#Unable to send web requests using fetch inside of a worker

1 messages · Page 1 of 1 (latest)

wooden canopy
#

That's not the syntax for fetch()

solar fable
#
 const response = await fetch("https://api.github.com/repos/Betrayed-hub/peter-hub/contents/allgames.json", options);
gaunt arrow
solar fable
#

403 would indicate GitHub blocked the request

gaunt arrow
#

that is how you set headers in fetch, that is the only reason they would block it.

vocal frost
gaunt arrow
#
  • fixed it, turns out I was not setting a user-agent and just figured fetch was doing it by default