Fetch inside a worker fails if the worker is invoked via a Pages function binding
hi folks 👋 I have a problem with a worker that's invoked from a Pages function via bindings, and I'd appreciate some help.
The worker is pretty simple, it uses
fetch
to download a JSON file, and then it responds with some data. When in call the worker directly using curl, it works as expected. However, when I call it using a Service binging from a Pages function, I get an error because the JSON file is invalid:
The code in the Pages function is trivial:
Does anyone know what I can do to make it work as expected? It looks like fetch
has some kind of issue when it's used in Pages functions, but I cannot find anything in the docs.0 Replies