From c94040d50d41269d3f716f542e0dd11cca06642a Mon Sep 17 00:00:00 2001 From: foxxcn Date: Sun, 11 Oct 2026 18:42:41 +0800 Subject: [PATCH] web: 404 unknown paths instead of serving index.html The embedded frontend was served with index.html as a catch-all, so /favicon.ico, /logs or any typo returned 200 text/html. The frontend has no client-side routes, so serve index.html only for / and let other misses 404. Add an inline SVG favicon so browsers stop requesting /favicon.ico. Co-Authored-By: Claude Opus 5.5 --- app/src/web/routes.rs | 5 ++++- crates/rkvm-web/index.html | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/web/routes.rs b/app/src/web/routes.rs index 4296bec..d7b36bc 100644 --- a/app/src/web/routes.rs +++ b/app/src/web/routes.rs @@ -95,7 +95,10 @@ pub(super) async fn init_static_routes() -> Result { .push( Router::with_path("{*path}") .hoop(compression) - .get(static_embed::().fallback("index.html")), + // Only "/" maps to the app; the frontend has no client-side + // routes, so unknown paths (and /favicon.ico) get a 404 + // rather than index.html served as every file. + .get(static_embed::().defaults("index.html")), ) }; Ok(router) diff --git a/crates/rkvm-web/index.html b/crates/rkvm-web/index.html index 2910191..0de0365 100644 --- a/crates/rkvm-web/index.html +++ b/crates/rkvm-web/index.html @@ -4,6 +4,7 @@ rustkvm +