Snippet returning 404 when fetched from worker
Hi, I have a worker that I'm using to develop a snippet (have to use worker so that I can profile performance). Due to being a worker I'm using it via hitting a route with it and providing the path of the response it's modifying via a query parameter, however it seems that this URL returns a 404 response, when hitting it from my browser / wrangler locally returns a valid response.
3 Replies
Gotcha, it isn’t possible to modify the response of one snippet with another then?
https://developers.cloudflare.com/rules/snippets/how-it-works/ the second subheading here heavily suggests it’s possible to chain snippets “each snippet receives the modified request from the previous snippet”, is that just outdated docs
Cloudflare Docs
How it works
Cloudflare Snippets are executed based on rules defined within your zone. Here is how the process works:
Ah right, without divulging too much of my usecase we have 1 snippet that acts as a cache and router to return a JS script with different versions and ideally we could have a second snippet to sign the response of that one before passing it back for security reasons. I will probably have to look at using
global_fetch_strictly_public to enable that since from my testing it looks like you're right