Skip to content

Commit

Permalink
use .nest_service instead of .nest
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Jan 2, 2025
1 parent 7ad9f34 commit 7e2a6cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/web/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub(super) fn build_axum_routes() -> AxumRouter {
//
// This panics because of conflicting routes:
// - `/{name}/{version}/settings.html`
// - `/:crate/{version}/{target}`
// - `/{crate}/{version}/{target}`
//
AxumRouter::new()
// Well known resources, robots.txt and favicon.ico support redirection, the sitemap.xml
Expand All @@ -129,7 +129,9 @@ pub(super) fn build_axum_routes() -> AxumRouter {
"/favicon.ico",
get_static(|| async { Redirect::permanent("/-/static/favicon.ico") }),
)
.nest("/-/static", build_static_router())
// `.nest` with fallbacks is currently broken, `.nest_service works
// https://github.com/tokio-rs/axum/issues/3138
.nest_service("/-/static", build_static_router())
.route(
"/opensearch.xml",
get_static(|| async { Redirect::permanent("/-/static/opensearch.xml") }),
Expand Down

0 comments on commit 7e2a6cb

Please sign in to comment.