Worker is bypassed if query parameter is present
# workers-help
t
Hi, I noticed that index page (
/
) requests that contain query parameters (
?anything
) are served by the origin instead of one of workers. I'm not sure why this happens. I would like all requests to
/
to be served by CF. I've set up the example to illustrate this:
Copy code
$ curl https://test.0x0f.ru/
served from a worker
Copy code
$ curl https://test.0x0f.ru/?a=b
served by the origin
Routes
j
You'll need to use
test.0x0f.ru/*
as your route to catch query params
w
^
t
hmm. I'd only want the index page
/
to be handled by a worker, not the entire domain.
j
You can pass-through to the origin with
return fetch(request)
or similar, but I don't think you can catch query params without the wildcard unfortunately
t
oof. ok, thanks for the help 🥰