Skip to content

Commit cbcd317

Browse files
ralyodioclaude
andcommitted
pit: a parked name is a page, not a 404
/n/<name> answered 404 when nobody held the name. The body was the right page — the directory of what else lives under that ending — but the status said the URL had nothing at it. It does have something. This is the parking page every resolver and the browser extension send unpointed names to; it is the answer, not the absence of one. A 404 makes a working page read as broken to the browser, to a link checker, and to anything that looks at the status before the body. A malformed name still gets 400: `not-a-name` is not one label and one ending, and there is no page for it to be. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 409d5f5 commit cbcd317

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/pwa/src/routes/moshpit.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,12 @@ moshpitRouter.get("/n/:name", async (req, res) => {
232232
? await quoteName({ tld, label: parsed.label, buyerId: req.user.id })
233233
: null;
234234

235-
res.status(resolution.name_registered ? 200 : 404).send(page({
235+
// 200, not 404, even when nobody holds the name. The URL does have a
236+
// resource — this directory is the parking page every resolver and the
237+
// browser extension send unpointed names to, and it is the answer, not the
238+
// absence of one. A 404 makes a working page read as broken to the browser,
239+
// to a link checker, and to anything that treats the status before the body.
240+
res.status(200).send(page({
236241
title: resolution.name,
237242
body: directory({ resolution, tld, owner, names, tlds, quote, user: req.user, req }),
238243
}));

0 commit comments

Comments
 (0)