simplify: unify route structs, fix prefix collision, lint fixes

- Unify RouteConfig/RouteEntry/RouteResponse into single RouteEntry
- Fix prefix collision: /api no longer matches /apiary (segment boundary check)
- Add path traversal rejection in route API
- Extract MdnsAnnouncement struct (clippy type_complexity)
- cargo fmt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Razvan Dimescu
2026-03-23 06:57:57 +02:00
parent 5e5a6544bc
commit c836903db5
5 changed files with 107 additions and 40 deletions

View File

@@ -761,7 +761,10 @@ async fn add_route(
if store.add_route(&name, req.path, req.port, req.strip) {
Ok(StatusCode::CREATED)
} else {
Err((StatusCode::NOT_FOUND, format!("service '{}' not found", name)))
Err((
StatusCode::NOT_FOUND,
format!("service '{}' not found", name),
))
}
}