From 0e9c1fa26d2daf50f2b1674c4cbd1c9be77a68fc Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Sat, 6 Jun 2026 18:00:59 -0500 Subject: [PATCH] fix(404): handle 404s --- router/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/router/src/index.ts b/router/src/index.ts index 0b22426..139646a 100644 --- a/router/src/index.ts +++ b/router/src/index.ts @@ -11,10 +11,10 @@ function docsOrigin(host: string): string { if (match) { const [, slug, zone] = match; if (!/^[0-9a-f]{8}$/.test(slug)) { - return `https://${slug}-bombshell-docs.${zone}`; + return `https://${slug}-bombshell-docs.${zone}/`; } } - return "https://docs.bomb.sh"; + return "https://docs.bomb.sh/"; } export default { @@ -27,8 +27,9 @@ export default { // Special case for Starlight's 404 page let status = response.status; - if (status === 404) + if (status === 404) { response = await fetch(new URL("/docs/404.html", origin)) + } const headers = new Headers(response.headers); headers.set("Cross-Origin-Embedder-Policy", "require-corp"); -- knotmirror 0.0.1