@@ -496,7 +496,7 @@ pub(crate) async fn get_all_platforms(
496
496
Extension ( pool) : Extension < Pool > ,
497
497
uri : Uri ,
498
498
) -> AxumResult < AxumResponse > {
499
- let is_crate_root = uri. path ( ) . starts_with ( "/crate/" ) ;
499
+ let is_crate_root = uri. path ( ) . starts_with ( "/-/menus/platforms/ crate/" ) ;
500
500
let req_path: String = params. path . unwrap_or_default ( ) ;
501
501
let req_path: Vec < & str > = req_path. split ( '/' ) . collect ( ) ;
502
502
@@ -601,6 +601,11 @@ pub(crate) async fn get_all_platforms(
601
601
602
602
( target, inner_path. join ( "/" ) )
603
603
} ;
604
+ let inner_path = if inner_path. is_empty ( ) {
605
+ format ! ( "{name}/index.html" )
606
+ } else {
607
+ format ! ( "{name}/{inner_path}" )
608
+ } ;
604
609
605
610
let current_target = if latest_release. build_status {
606
611
if target. is_empty ( ) {
@@ -1293,7 +1298,7 @@ mod tests {
1293
1298
// Same test with AJAX endpoint.
1294
1299
let response = env
1295
1300
. frontend ( )
1296
- . get ( "/-/menus/platforms/dummy/latest/dummy" )
1301
+ . get ( "/-/menus/platforms/dummy/latest/dummy/ " )
1297
1302
. send ( ) ?;
1298
1303
assert ! ( response. status( ) . is_success( ) ) ;
1299
1304
check_links ( response. text ( ) ?, true , true ) ;
@@ -1307,7 +1312,7 @@ mod tests {
1307
1312
// Same test with AJAX endpoint.
1308
1313
let response = env
1309
1314
. 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/ " )
1311
1316
. send ( ) ?;
1312
1317
assert ! ( response. status( ) . is_success( ) ) ;
1313
1318
check_links ( response. text ( ) ?, true , true ) ;
0 commit comments