diff --git a/src/web/routes.rs b/src/web/routes.rs index 64fb19321..808be44e2 100644 --- a/src/web/routes.rs +++ b/src/web/routes.rs @@ -328,6 +328,10 @@ pub(super) fn build_axum_routes() -> AxumRouter { "/:name/:version/all.html", get_rustdoc(super::rustdoc::rustdoc_html_server_handler), ) + .route( + "/:name/:version/help.html", + get_rustdoc(super::rustdoc::rustdoc_html_server_handler), + ) .route( "/:name/:version/settings.html", get_rustdoc(super::rustdoc::rustdoc_html_server_handler), diff --git a/src/web/rustdoc.rs b/src/web/rustdoc.rs index 1bdd334b3..581deb84d 100644 --- a/src/web/rustdoc.rs +++ b/src/web/rustdoc.rs @@ -966,6 +966,29 @@ mod test { .with_context(|| anyhow::anyhow!("no redirect found for {}", path)) } + #[test_case(true)] + #[test_case(false)] + // https://github.com/rust-lang/docs.rs/issues/2313 + fn help_html(archive_storage: bool) { + wrapper(|env| { + env.fake_release() + .name("krate") + .version("0.1.0") + .archive_storage(archive_storage) + .rustdoc_file("help.html") + .create()?; + let web = env.frontend(); + assert_success_cached("/", web, CachePolicy::NoCaching, &env.config())?; + assert_success_cached( + "/krate/0.1.0/help.html", + web, + CachePolicy::ForeverInCdnAndStaleInBrowser, + &env.config(), + )?; + Ok(()) + }); + } + #[test_case(true)] #[test_case(false)] // regression test for https://github.com/rust-lang/docs.rs/issues/552