@@ -505,7 +505,7 @@ pub(crate) async fn get_all_platforms(
505505 Extension ( pool) : Extension < Pool > ,
506506 uri : Uri ,
507507) -> AxumResult < AxumResponse > {
508- let is_crate_root = uri. path ( ) . starts_with ( "/crate/" ) ;
508+ let is_crate_root = uri. path ( ) . starts_with ( "/-/menus/platforms/ crate/" ) ;
509509 let req_path: String = params. path . unwrap_or_default ( ) ;
510510 let req_path: Vec < & str > = req_path. split ( '/' ) . collect ( ) ;
511511
@@ -610,6 +610,11 @@ pub(crate) async fn get_all_platforms(
610610
611611 ( target, inner_path. join ( "/" ) )
612612 } ;
613+ let inner_path = if inner_path. is_empty ( ) {
614+ format ! ( "{name}/index.html" )
615+ } else {
616+ format ! ( "{name}/{inner_path}" )
617+ } ;
613618
614619 let current_target = if latest_release. build_status {
615620 if target. is_empty ( ) {
@@ -1302,7 +1307,7 @@ mod tests {
13021307 // Same test with AJAX endpoint.
13031308 let response = env
13041309 . frontend ( )
1305- . get ( "/-/menus/platforms/dummy/latest/dummy" )
1310+ . get ( "/-/menus/platforms/dummy/latest/dummy/ " )
13061311 . send ( ) ?;
13071312 assert ! ( response. status( ) . is_success( ) ) ;
13081313 check_links ( response. text ( ) ?, true , true ) ;
@@ -1316,7 +1321,7 @@ mod tests {
13161321 // Same test with AJAX endpoint.
13171322 let response = env
13181323 . frontend ( )
1319- . get ( "/-/menus/platforms/dummy/0.4.0/x86_64-pc-windows-msvc/dummy" )
1324+ . get ( "/-/menus/platforms/dummy/0.4.0/x86_64-pc-windows-msvc/dummy/ " )
13201325 . send ( ) ?;
13211326 assert ! ( response. status( ) . is_success( ) ) ;
13221327 check_links ( response. text ( ) ?, true , true ) ;
0 commit comments