@@ -496,11 +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 = params
500
- . path
501
- . as_ref ( )
502
- . map ( |path| path == "index.html" )
503
- . unwrap_or ( true ) ;
499
+ let is_crate_root = uri. path ( ) . starts_with ( "/crate/" ) ;
504
500
let req_path: String = params. path . unwrap_or_default ( ) ;
505
501
let req_path: Vec < & str > = req_path. split ( '/' ) . collect ( ) ;
506
502
@@ -1280,6 +1276,17 @@ mod tests {
1280
1276
. add_target ( "x86_64-pc-windows-msvc" )
1281
1277
. create ( ) ?;
1282
1278
1279
+ let response = env. frontend ( ) . get ( "/crate/dummy/0.4.0" ) . send ( ) ?;
1280
+ assert ! ( response. status( ) . is_success( ) ) ;
1281
+ check_links ( response. text ( ) ?, false , false ) ;
1282
+ // Same test with AJAX endpoint.
1283
+ let response = env
1284
+ . frontend ( )
1285
+ . get ( "/-/menus/platforms/crate/dummy/0.4.0" )
1286
+ . send ( ) ?;
1287
+ assert ! ( response. status( ) . is_success( ) ) ;
1288
+ check_links ( response. text ( ) ?, true , false ) ;
1289
+
1283
1290
let response = env. frontend ( ) . get ( "/dummy/latest/dummy" ) . send ( ) ?;
1284
1291
assert ! ( response. status( ) . is_success( ) ) ;
1285
1292
check_links ( response. text ( ) ?, false , true ) ;
@@ -1289,7 +1296,7 @@ mod tests {
1289
1296
. get ( "/-/menus/platforms/dummy/latest/dummy" )
1290
1297
. send ( ) ?;
1291
1298
assert ! ( response. status( ) . is_success( ) ) ;
1292
- check_links ( response. text ( ) ?, true , false ) ;
1299
+ check_links ( response. text ( ) ?, true , true ) ;
1293
1300
1294
1301
let response = env
1295
1302
. frontend ( )
0 commit comments