fix(routing): prevent cached 301 redirects on root and standalone domains
Root route now sends no-cache headers to bust stale 301s from the rcal standaloneDomain mishap. Standalone domain redirects changed from 301 (permanent/browser-cached) to 302 (temporary) so misconfiguration can never stick in user browsers again. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c037e13423
commit
6c1298b796
|
|
@ -2936,6 +2936,7 @@ for (const mod of getAllModules()) {
|
||||||
|
|
||||||
// Landing page: rspace.online/ → server-rendered main landing
|
// Landing page: rspace.online/ → server-rendered main landing
|
||||||
app.get("/", (c) => {
|
app.get("/", (c) => {
|
||||||
|
c.header("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||||
return c.html(renderMainLanding(getModuleInfoList()));
|
return c.html(renderMainLanding(getModuleInfoList()));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -3352,7 +3353,7 @@ const server = Bun.serve<WSData>({
|
||||||
redirectUrl = `https://rspace.online/${standaloneModuleId}${remainingPath}`;
|
redirectUrl = `https://rspace.online/${standaloneModuleId}${remainingPath}`;
|
||||||
}
|
}
|
||||||
if (url.search) redirectUrl += url.search;
|
if (url.search) redirectUrl += url.search;
|
||||||
return Response.redirect(redirectUrl, 301);
|
return Response.redirect(redirectUrl, 302);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── WebSocket upgrade ──
|
// ── WebSocket upgrade ──
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue