@@ -218,7 +218,7 @@ pub(crate) async fn rustdoc_redirector_handler(
218
218
// This is fixed in rustdoc, but pending a rebuild for
219
219
// docs that were affected by this bug.
220
220
// https://github.com/rust-lang/docs.rs/issues/1979
221
- if target. starts_with ( "search-" ) {
221
+ if target. starts_with ( "search-" ) || target . starts_with ( "settings-" ) {
222
222
return try_serve_legacy_toolchain_asset ( storage, config, target) . await ;
223
223
} else {
224
224
return Err ( err. into ( ) ) ;
@@ -2595,8 +2595,9 @@ mod test {
2595
2595
} ) ;
2596
2596
}
2597
2597
2598
- #[ test]
2599
- fn fallback_to_root_storage_for_search_js_assets ( ) {
2598
+ #[ test_case( "search-1234.js" ) ]
2599
+ #[ test_case( "settings-1234.js" ) ]
2600
+ fn fallback_to_root_storage_for_some_js_assets ( path : & str ) {
2600
2601
// test workaround for https://github.com/rust-lang/docs.rs/issues/1979
2601
2602
wrapper ( |env| {
2602
2603
env. fake_release ( )
@@ -2606,8 +2607,7 @@ mod test {
2606
2607
. create ( ) ?;
2607
2608
2608
2609
env. storage ( ) . store_one ( "asset.js" , * b"content" ) ?;
2609
- env. storage ( )
2610
- . store_one ( "search-1234.js" , * b"more_content" ) ?;
2610
+ env. storage ( ) . store_one ( path, * b"more_content" ) ?;
2611
2611
2612
2612
let web = env. frontend ( ) ;
2613
2613
@@ -2617,8 +2617,8 @@ mod test {
2617
2617
) ;
2618
2618
assert ! ( web. get( "/asset.js" ) . send( ) ?. status( ) . is_success( ) ) ;
2619
2619
2620
- assert ! ( web. get( "/search-1234.js" ) . send( ) ?. status( ) . is_success( ) ) ;
2621
- let response = web. get ( "/dummy/0.1.0/search-1234.js" ) . send ( ) ?;
2620
+ assert ! ( web. get( & format! ( "/{path}" ) ) . send( ) ?. status( ) . is_success( ) ) ;
2621
+ let response = web. get ( & format ! ( "/dummy/0.1.0/{path}" ) ) . send ( ) ?;
2622
2622
assert ! ( response. status( ) . is_success( ) ) ;
2623
2623
assert_eq ! ( response. text( ) ?, "more_content" ) ;
2624
2624
0 commit comments