@@ -505,7 +505,7 @@ pub(crate) async fn get_all_platforms(
505
505
Extension ( pool) : Extension < Pool > ,
506
506
uri : Uri ,
507
507
) -> AxumResult < AxumResponse > {
508
- let is_crate_root = uri. path ( ) . starts_with ( "/crate/" ) ;
508
+ let is_crate_root = uri. path ( ) . starts_with ( "/-/menus/platforms/ crate/" ) ;
509
509
let req_path: String = params. path . unwrap_or_default ( ) ;
510
510
let req_path: Vec < & str > = req_path. split ( '/' ) . collect ( ) ;
511
511
@@ -610,6 +610,11 @@ pub(crate) async fn get_all_platforms(
610
610
611
611
( target, inner_path. join ( "/" ) )
612
612
} ;
613
+ let inner_path = if inner_path. is_empty ( ) {
614
+ format ! ( "{name}/index.html" )
615
+ } else {
616
+ format ! ( "{name}/{inner_path}" )
617
+ } ;
613
618
614
619
let current_target = if latest_release. build_status {
615
620
if target. is_empty ( ) {
@@ -1302,7 +1307,7 @@ mod tests {
1302
1307
// Same test with AJAX endpoint.
1303
1308
let response = env
1304
1309
. frontend ( )
1305
- . get ( "/-/menus/platforms/dummy/latest/dummy" )
1310
+ . get ( "/-/menus/platforms/dummy/latest/dummy/ " )
1306
1311
. send ( ) ?;
1307
1312
assert ! ( response. status( ) . is_success( ) ) ;
1308
1313
check_links ( response. text ( ) ?, true , true ) ;
@@ -1316,7 +1321,7 @@ mod tests {
1316
1321
// Same test with AJAX endpoint.
1317
1322
let response = env
1318
1323
. 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/ " )
1320
1325
. send ( ) ?;
1321
1326
assert ! ( response. status( ) . is_success( ) ) ;
1322
1327
check_links ( response. text ( ) ?, true , true ) ;
0 commit comments