Skip to content

Commit

Permalink
fix showing help.html from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Nov 15, 2023
1 parent 3e03316 commit 8b1a920
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/web/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
23 changes: 23 additions & 0 deletions src/web/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b1a920

Please sign in to comment.