@@ -496,11 +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 = 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/" ) ;
504500 let req_path: String = params. path . unwrap_or_default ( ) ;
505501 let req_path: Vec < & str > = req_path. split ( '/' ) . collect ( ) ;
506502
@@ -1280,6 +1276,17 @@ mod tests {
12801276 . add_target ( "x86_64-pc-windows-msvc" )
12811277 . create ( ) ?;
12821278
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+
12831290 let response = env. frontend ( ) . get ( "/dummy/latest/dummy" ) . send ( ) ?;
12841291 assert ! ( response. status( ) . is_success( ) ) ;
12851292 check_links ( response. text ( ) ?, false , true ) ;
@@ -1289,7 +1296,7 @@ mod tests {
12891296 . get ( "/-/menus/platforms/dummy/latest/dummy" )
12901297 . send ( ) ?;
12911298 assert ! ( response. status( ) . is_success( ) ) ;
1292- check_links ( response. text ( ) ?, true , false ) ;
1299+ check_links ( response. text ( ) ?, true , true ) ;
12931300
12941301 let response = env
12951302 . frontend ( )
0 commit comments