Worker (almost) break Page Rule not showing redirection on the browser

Hi there!

I’m beginning to work with workers to add security headers to the responses. I’m following this guide: The brand new Security Headers Cloudflare Worker. It works like a charm, but I found out when the worker broke the Page Rules in some way. Let me explain it.
I have a Page Rule to redirect every user that arrives at the root to a When the worker is running, I can see the content of the web page is the content on, but the URL in the web browser shows I reduced the code to the following, but it keeps showing the described behavior.

addEventListener(“fetch”, event => {

I know I can perform that redirection inside the worker, but I want to keep those rules under the Page Rules management.

Any idea what could I do?