Weird issues with Workers and Custom Domains

Hello,

I recently added Custom Domains to my two Workers, and everything seemed to go smooth.

I then noticed some strange behaviour. My Worker started appearing on multiple paths/directories of my domain, and I can easily reproduce this issue.

The steps to reproduce are:

  1. Close Chrome/Browser
  2. Open Chrome/Browser
  3. Go to bfstats-api.leonlarsson.com and see the API response
  4. Go to leon.ms, leonlarsson.com, leonlarsson.com/projects, etc. (either on the same tab or a new tab), and see the same API response.

None of the URLs in step 4 should show a JSON response. The JSON response is what my Worker produces.

This is the Custom Domains setup for my Worker:


The Worker is accessible at that link.

This is the DNS setup for the leonlarsson.com domain: https://i.imgur.com/m0DoFEh.png

And yet when I reproduce this issue, the logs from my Worker indeed show that the URL triggering it is not tied to my Worker’s Custom Domain: https://i.imgur.com/WIQeMlO.png

I can also reproduce this on my other Worker:
Go to api.onlyraccoons.com, then go to onlyraccoons.com
This is the DNS for onlyraccoons.com: https://i.imgur.com/jCY7boG.png

Neither leonlarsson.com nor onlyraccoons.com have any Page Rules.

This is the code running on the Worker with the Custom Domain “bfstats-api.leonlarsson.com”: GitHub Repo

I would appreciate any help I could get. Thanks!
(Sorry, could only embed one image, and couldn’t have more than 4 links)

1 Like

I’ve pinged the PM and Engineer, they should give you some feedback.

3 Likes

Hi, is it possible to get an update on this? Still happening, unfortunately.

Hi Mozzy, thanks for the extensive report.

We are aware of the issue and have identified the root cause. We are working on a fix, but no ETA yet.

1 Like

Thanks!