Route matching a space

I have a page rule that simply redirects a URL to a different location. I want to move that over to a worker.

The page rule settings:
https://blah.com/Old%20Area/File.zip
Forwarding URL (Status Code: 301 - Permanent Redirect, Url: https://new.com/File.zip)

The %20 is the URL encoded space. This page rule has always worked without issue.

Now I set up a worker route and link it to a worker script. I wait a few minutes and it doesn’t work - the request doesn’t enter the worker and goes straight to the origin. I then remove the %20 and just leave a space. It doesn’t work then either. I then test my redirect worker script with a URL that doesn’t have a space and it works straight away.

I can’t figure out why this URL works in a page rule but not a worker route. The issue is not with the script because the request doesn’t get that far. The route is obviously not matching up. Any idea why?

Haha, yep, I can reproduce this. What a nice little bug. I will send this over to the team and make sure it reaches the right people :slight_smile:

1 Like

Thank you very much!
Spent a few hours trying to find out what I was doing wrong. :upside_down_face:

@Walshy Is there any update?

Hey, there’s an internal ticket for it but I don’t think it’s a super high priority fix.