Skip to content

Conversation

@krishnamuppaneni
Copy link

@krishnamuppaneni krishnamuppaneni commented Sep 30, 2025

This PR refactors the Cloudflare Worker's zone handling logic in worker.js to prevent exceptions when requests for unknown zones are processed.

Added explicit handling for cases where no zone is found for a request:

  • If getZoneFromReqURL() returns null/undefined, the worker now logs "No zone found for this request" and early exits
  • This prevents further processing for domains that aren't configured
  • This also prevents unnecessary KV reads for unknown zones and will early exit

Copy link
Contributor

@rr404 rr404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok @blotus what do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants