Skip to content

Commit 2ae5166

Browse files
hhkaosclaude
andcommitted
fix(validator): keep one canonical hostname for the tool
fetch.opentechevents.org was declared alongside validator.opentechevents.org to give the fetcher an "API name". It did not: assets are served before the Worker script runs, so that hostname served the whole page as well — two canonical URLs for one tool, which is precisely what keeping /validator/ as a redirect exists to prevent. An API hostname, if ever genuinely wanted, needs its own Worker without an assets binding rather than another route onto this one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent d10223d commit 2ae5166

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

workers/validator/wrangler.jsonc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919
"not_found_handling": "404-page"
2020
},
2121

22-
"routes": [
23-
// The tool's public name. tools.opentechevents.org/validator/ redirects
24-
// here, so there is one canonical URL for permalinks pasted into issues.
25-
{ "pattern": "validator.opentechevents.org", "custom_domain": true },
26-
// The fetch endpoint's own name, kept so the SSRF-guarded fetcher can be
27-
// addressed as an API by other tools later without going through the
28-
// validator's hostname.
29-
{ "pattern": "fetch.opentechevents.org", "custom_domain": true }
30-
],
22+
// One hostname, deliberately. A second custom domain (fetch.opentechevents.org
23+
// was tried) does not give the fetcher an "API name": assets are served
24+
// before this script runs, so that hostname served the whole page too — two
25+
// canonical URLs for one tool, which is what the /validator/ redirect exists
26+
// to avoid. If an API name is ever genuinely wanted, it needs its own Worker
27+
// without an assets binding, not another route onto this one.
28+
"routes": [{ "pattern": "validator.opentechevents.org", "custom_domain": true }],
3129
// Declaring `routes` makes wrangler disable the workers.dev URL by default.
3230
// Keep it: it is what local development and CI smoke checks point at before
3331
// DNS exists, and the fallback if a custom domain ever misbehaves.

0 commit comments

Comments
 (0)