Fix /rtasks/check/:token 404 — bypass module rewriting for checklist routes

The bare-domain and subdomain routing intercepted /rtasks/check/* paths,
rewriting them to /demo/rtasks/check/* which didn't match any route.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-16 12:32:00 -07:00
parent 8cf069f2b7
commit aabc2de7d8
1 changed files with 6 additions and 0 deletions

View File

@ -2325,6 +2325,7 @@ const server = Bun.serve<WSData>({
url.pathname.startsWith("/api/") ||
url.pathname.startsWith("/data/") ||
url.pathname.startsWith("/encryptid/") ||
url.pathname.startsWith("/rtasks/check/") ||
url.pathname.startsWith("/.well-known/") ||
url.pathname === "/about" ||
url.pathname === "/admin" ||
@ -2393,6 +2394,11 @@ const server = Bun.serve<WSData>({
// ── Bare-domain routing: rspace.online/{...} ──
if (!subdomain && hostClean.includes("rspace.online")) {
// Top-level routes that must bypass module rewriting
if (url.pathname.startsWith("/rtasks/check/")) {
return app.fetch(req);
}
const pathSegments = url.pathname.split("/").filter(Boolean);
if (pathSegments.length >= 1) {
const firstSegment = pathSegments[0].toLowerCase();