@@ -505,11 +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 = params
509
- . path
510
- . as_ref ( )
511
- . map ( |path| path == "index.html" )
512
- . unwrap_or ( true ) ;
508
+ let is_crate_root = uri. path ( ) . starts_with ( "/crate/" ) ;
513
509
let req_path: String = params. path . unwrap_or_default ( ) ;
514
510
let req_path: Vec < & str > = req_path. split ( '/' ) . collect ( ) ;
515
511
@@ -1289,6 +1285,17 @@ mod tests {
1289
1285
. add_target ( "x86_64-pc-windows-msvc" )
1290
1286
. create ( ) ?;
1291
1287
1288
+ let response = env. frontend ( ) . get ( "/crate/dummy/0.4.0" ) . send ( ) ?;
1289
+ assert ! ( response. status( ) . is_success( ) ) ;
1290
+ check_links ( response. text ( ) ?, false , false ) ;
1291
+ // Same test with AJAX endpoint.
1292
+ let response = env
1293
+ . frontend ( )
1294
+ . get ( "/-/menus/platforms/crate/dummy/0.4.0" )
1295
+ . send ( ) ?;
1296
+ assert ! ( response. status( ) . is_success( ) ) ;
1297
+ check_links ( response. text ( ) ?, true , false ) ;
1298
+
1292
1299
let response = env. frontend ( ) . get ( "/dummy/latest/dummy" ) . send ( ) ?;
1293
1300
assert ! ( response. status( ) . is_success( ) ) ;
1294
1301
check_links ( response. text ( ) ?, false , true ) ;
@@ -1298,7 +1305,7 @@ mod tests {
1298
1305
. get ( "/-/menus/platforms/dummy/latest/dummy" )
1299
1306
. send ( ) ?;
1300
1307
assert ! ( response. status( ) . is_success( ) ) ;
1301
- check_links ( response. text ( ) ?, true , false ) ;
1308
+ check_links ( response. text ( ) ?, true , true ) ;
1302
1309
1303
1310
let response = env
1304
1311
. frontend ( )
0 commit comments