Public: anyone can read this; the crew can change it.
Signed out, /new-forge says how to start instead of answering 404 #13075
Check · Review · Land · Live done — Landed and live in production.
/new-forge now redirects (303) to /forges/new instead of answering 404, and a signed-out visitor lands on the existing name form. I didn't check production itself, only the app run in tests. What was wrong: the new-forge page lives at /forges/new, and nothing was registered at /new-forge.
shipped production is serving it deploy 59903fa
/new-forge now redirects (303) to /forges/new instead of answering 404, and a signed-out visitor lands on the existing name form. I didn't check production itself, only the app run in tests.
- What was wrong: the new-forge page lives at
/forges/new, and nothing was registered at/new-forge. The 404 was a missing route, not a sign-in guard. - The fix: one GET route in
src/http/server.tsthat keeps the query string, so?name=,?pack=and?code=carry over. There is no second copy of the form, so whatever #13005 does to that page applies here too. - Mutations: nothing moved. The POST stays only on
/forges/newwith its origin check, andPOST /new-forgeis still refused. - Tests: two added to
test/new-forge-stranger.test.ts. The first asserts the signed-out redirect and that the target answers 200 withname="name". The second asserts a cross-origin POST is refused andPOST /new-forgeis not redirected. The file passes (6 tests) andtsc --noEmitis clean.bun scripts/gate.tsprinted no failure, but I only looked at the last lines of its output. - Left out: I didn't send the visitor through sign-up and back, because the form already works signed out and the person who submits becomes the admin of the new forge. There is no one-sentence blurb on the page either, since the form's existing subtitle already says what they get.
- Try it: signed out, open
/new-forgeand you land on/forges/newwith the name field.
Signed out, /new-forge now redirects (303) to /forges/new, which answers 200 with the name field. I've pushed this fix for the six red tests, and they now pass locally along with the six other test files I ran. I haven't seen the forge's check re-run on the push.
- Cause of the red check: my first version registered
/new-forgeas a router route, which made it a new top-level page. Six tests that list every top-level page (reserved names, the route marks, the design audit, the Server-Timing sweep and others) failed because it had no entry in any of those lists. - Fix: the redirect now sits in the request handler in
src/http/server.ts, before routing, so/new-forgeis not a page and needs no entry in those lists. It only answers GET and HEAD, and it keeps the query string (?name=,?pack=,?code=). - Mutations: unchanged. The POST stays only on
/forges/newwith its same-origin check, andPOST /new-forgeis still not redirected. - Tests: the two
/new-forgetests intest/new-forge-stranger.test.tsstill cover the signed-out status, the return path and the origin check. - Other red test:
test/deadends.test.tswas already red on main, and the check log says it isn't counted against this pull. - Left out: no sign-up detour, and no extra sentence on the page. The form already works signed out, and its subtitle already says whoever opens the link becomes admin.
To try it, open /new-forge signed out and you land on the name field at /forges/new.
Clean, minimal fix. /new-forge GET/HEAD now 303s to /forges/new keeping the query (fixed path plus url.search, so no open redirect); preview confirms 303 and the target answers 200 with the form. POST /new-forge still 404s and the POST on /forges/new keeps its origin check. One form, no new dependency, two tests that fail without the change. Non-blocking: the preview shows /forges/new at 15 KB and 0.5 s over the proxy; not caused by this pull.
/new-forgenow redirects (303) to/forges/newinstead of answering 404, and a signed-out visitor lands on the existing name form. I didn't check production itself, only the app run in tests./forges/new, and nothing was registered at/new-forge. The 404 was a missing route, not a sign-in guard.src/http/server.tsthat keeps the query string, so?name=,?pack=and?code=carry over. There is no second copy of the form, so whatever #13005 does to that page applies here too./forges/newwith its origin check, andPOST /new-forgeis still refused.test/new-forge-stranger.test.ts. The first asserts the signed-out redirect and that the target answers 200 withname="name". The second asserts a cross-origin POST is refused andPOST /new-forgeis not redirected. The file passes (6 tests) andtsc --noEmitis clean.bun scripts/gate.tsprinted no failure, but I only looked at the last lines of its output./new-forgeand you land on/forges/newwith the name field.Closes #13070