feat(parking): serve /parking?name=<domain> as a tenant page - #86
Merged
Conversation
Registrar parking and forwarding links point at /parking?name=<domain>, but no such route existed — every one of them 404'd. Parked domains are only reachable at /?dn=<domain>. Add /parking as a thin alias that normalizes name -> dn and delegates to the tenant renderer at /, rather than redirecting: the link a registrar already holds stays valid and masked forwarding never sees a hop. Every other param (?ref, ?brand, ?social_*, ?link_N, …) passes through untouched, so the two URLs cannot drift. Middleware learns ?name= alongside ?dn= in both places it matters: frame-ancestors (so a masked domain can still frame its own page) and referral attribution (Porkbun glues ?ref= onto the value, and safeDomain strips it, so it has to be lifted out before it's lost). No name -> the renderer falls back to <Landing />, not a 404. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
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.
https://moshcoding.com/parking?name=scrambled.eggsreturns 404, and so does every other/parking?name=link — the route has never existed. Parked domains are only reachable at/?dn=<domain>.Change
Add
/parkingas a thin alias that normalizesname→dnand delegates to the tenant renderer at/. It renders in place instead of redirecting, so a link a registrar already holds stays valid and masked forwarding never sees a hop. Every other param (?ref,?brand,?social_*,?link_N, …) passes straight through, so the two URLs can't drift.Middleware learns
?name=alongside?dn=in the two places it matters:/parking?name=<self>can still frame its own page?ref=onto the value andsafeDomain()strips it, so it has to be lifted out before it's lostNo name → the renderer falls back to
<Landing />, not a 404.Verification
Built and served locally (
bun run build && bun run start):/parking?name=scrambled.eggs<title>Scrambled IS COMING</title>/?dn=scrambled.eggs/parking(no name)/parking?name=scrambled.eggs%3Fref%3Dabc123mc_ref=abc123bun test tests/— 148 pass, 0 fail (6 new).🤖 Generated with Claude Code