@@ -496,7 +496,7 @@ pub(crate) async fn get_all_platforms(
496496 Extension ( pool) : Extension < Pool > ,
497497 uri : Uri ,
498498) -> AxumResult < AxumResponse > {
499- let is_crate_root = uri. path ( ) . starts_with ( "/crate/" ) ;
499+ let is_crate_root = uri. path ( ) . contains ( "/crate/" ) ;
500500 let req_path: String = params. path . unwrap_or_default ( ) ;
501501 let req_path: Vec < & str > = req_path. split ( '/' ) . collect ( ) ;
502502
@@ -601,6 +601,11 @@ pub(crate) async fn get_all_platforms(
601601
602602 ( target, inner_path. join ( "/" ) )
603603 } ;
604+ let inner_path = if inner_path. is_empty ( ) {
605+ format ! ( "{name}/index.html" )
606+ } else {
607+ format ! ( "{name}/{inner_path}" )
608+ } ;
604609
605610 let current_target = if latest_release. build_status {
606611 if target. is_empty ( ) {
@@ -1293,7 +1298,7 @@ mod tests {
12931298 // Same test with AJAX endpoint.
12941299 let response = env
12951300 . frontend ( )
1296- . get ( "/-/menus/platforms/dummy/latest/dummy" )
1301+ . get ( "/-/menus/platforms/dummy/latest/dummy/ " )
12971302 . send ( ) ?;
12981303 assert ! ( response. status( ) . is_success( ) ) ;
12991304 check_links ( response. text ( ) ?, true , true ) ;
@@ -1307,7 +1312,7 @@ mod tests {
13071312 // Same test with AJAX endpoint.
13081313 let response = env
13091314 . frontend ( )
1310- . get ( "/-/menus/platforms/dummy/0.4.0/x86_64-pc-windows-msvc/dummy" )
1315+ . get ( "/-/menus/platforms/dummy/0.4.0/x86_64-pc-windows-msvc/dummy/ " )
13111316 . send ( ) ?;
13121317 assert ! ( response. status( ) . is_success( ) ) ;
13131318 check_links ( response. text ( ) ?, true , true ) ;
0 commit comments