fix(landing): 404 unknown paths instead of serving the landing page - #193
Open
Rumblingb wants to merge 1 commit into
Open
fix(landing): 404 unknown paths instead of serving the landing page#193Rumblingb wants to merge 1 commit into
Rumblingb wants to merge 1 commit into
Conversation
handleRequest ended in a catch-all that returned the landing page with HTTP 200 for every unmatched path. That hid broken links — a dead route was byte-identical to a live one, which is how the stale deployment of /awesome-free-dev-tools/buy went unnoticed — and let crawlers index unlimited duplicate copies of the landing page. Serve the landing page only at / and /index.html; everything else gets the existing renderNotFoundPage at status 404. renderNotFoundPage takes an optional hint so it can be reused outside the AgentRank path without claiming the visitor mistyped an agent identifier. Adds regression coverage for the 404 behaviour, plus verify-routing.mjs (public gate asserting known routes still 200, /buy still 302s to Stripe, and unknown paths 404) and deploy-routing-fix.sh, which records the current 100%-traffic version and rolls back automatically if that verification fails. The deploy script also guards Node >=22, which wrangler 4.x requires and this repo's default 20.18.0 does not meet. Verified: node --test 1/1 pass, node --check clean, wrangler --dry-run builds (66.86 KiB), and verify-routing.mjs run against live production fails on exactly the four broken routes while passing the nine healthy ones. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
Not merged — blocked by failing checks. Commit
No merge conflict ( Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
handleRequestended in a catch-all that returned the landing page with HTTP 200 for every unmatched path. This serves the landing page only at/and/index.html; everything else returns the existingrenderNotFoundPageat 404.Adds
verify-routing.mjs(public verification gate) anddeploy-routing-fix.sh(rollback-protected deploy, modelled ondeploy-postizzz-review.sh).Why it matters
A dead route was byte-identical to a live one. That is precisely how the stale deployment of
/awesome-free-dev-tools/buywent unnoticed — and it lets crawlers index unlimited duplicate copies of the landing page.Verified against live production right now:
/awesome-free-dev-tools/buyreturns200with noLocationheader. Clicking buy serves the landing page instead of Stripe. The checkout path is currently dead in production.Note the code for that redirect is already correct on this branch and covered by a passing test — the live Worker is simply stale. This PR does not fix that on its own; the deploy does.
Verification
node --test worker.test.mjs→ 1/1 passnode --check worker.js→ cleanwrangler deploy --strict --dry-run→ builds, 66.86 KiB / 17.60 KiB gzipverify-routing.mjsagainst live production → fails on exactly the 4 broken routes, passes the 9 healthy onesRouting table after the change:
/,/index.html/awesome-free-dev-tools,/terms,/privacy,/postizzz,/rank/<agent>,/health/awesome-free-dev-tools/buybuy.stripe.comnoindexBase branch
Targets
codex/founder-orchestration-2026-07-11, notmain— the landing worker does not exist onmain(0 files there). Cherry-picked onto the pushed codex tip3623a199so this PR contains exactly one commit; the 7 locally-unpushed commits on that branch are deliberately not included.Deploy note
deploy-routing-fix.shguards Node >= 22, which wrangler 4.x requires and the repo's default 20.18.0 does not meet — the existing deploy script would fail there.🤖 Generated with Claude Code