Skip to content

web: 404 unknown paths instead of serving index.html - #49

Merged
Rust-KVM merged 1 commit into
devfrom
claude/web-404-unknown-paths
Oct 11, 2026
Merged

Rust-KVM merged 1 commit into
devfrom
claude/web-404-unknown-paths

Conversation

@Rust-KVM

Copy link
Copy Markdown
Owner

Requested by 4c · project thread

Summary

Before: any unknown path, including /favicon.ico, returned index.html with 200, so typos and probes looked like valid pages and the browser got HTML as its favicon.

After: only / serves the app; unknown paths return 404. The page carries an inline SVG favicon so browsers stop asking for /favicon.ico.

How

routes.rs: the static embed handler uses .defaults("index.html") (directory index only) instead of .fallback("index.html"). The frontend has no client-side routes, so nothing relied on the fallback. index.html gets a data: SVG <link rel="icon">.

Testing

  • cargo +nightly fmt --all (CI)
  • cargo +nightly clippy --workspace --release --all-targets -- -D warnings (CI)
  • cargo +nightly test --workspace (CI)
  • Frontend touched: trunk build --locked and wasm32 clippy in crates/rkvm-web (CI)
  • Tested on an RK3588 device: a build merging all five round-2 branches was deployed to the NanoPC-T6; / returns 200, unknown paths return 404, startup log has no WARN/ERROR.

Checklist

  • No #[allow(...)] suppressions and no new unwrap() / expect() in production paths
  • Hot paths stay zero-copy; periodic loops use MissedTickBehavior::Delay
  • Shared protocol types live in rkvm-proto
  • RPC method set changed → not applicable
  • Module tree or build invariants changed → not applicable

Round 2 of the web UI retest fixes (minor issues). The five round-2 branches merge onto dev together without conflicts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PbdzY6PfT28goR4BhqdsXR


Generated by Claude Code

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 <noreply@anthropic.com>
@github-actions github-actions Bot added area: api JSON-RPC, HTTP routes, MCP, MQTT rkvm-web Leptos / WASM frontend labels Oct 11, 2026
@Rust-KVM Rust-KVM self-assigned this Oct 11, 2026
@Rust-KVM
Rust-KVM merged commit d80567c into dev Oct 11, 2026
13 checks passed
@Rust-KVM
Rust-KVM deleted the claude/web-404-unknown-paths branch October 12, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: api JSON-RPC, HTTP routes, MCP, MQTT rkvm-web Leptos / WASM frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants