Skip to content

Commit 261c133

Browse files
committed
add more explaining comments
1 parent f857f2a commit 261c133

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/web/extractors/rustdoc.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,10 @@ mod tests {
17001700

17011701
#[test]
17021702
fn test_item_with_semver_url() {
1703-
// https://github.com/rust-lang/docs.rs/iss
1703+
// https://github.com/rust-lang/docs.rs/issues/3036
1704+
// This fixes an issue where we mistakenly attached a
1705+
// trailing `/` to a rustdoc URL when redirecting
1706+
// to the exact version, coming from a semver version.
17041707

17051708
let ver: Version = "0.14.0".parse().unwrap();
17061709
let params = RustdocParams::new(KRATE)

src/web/rustdoc.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ pub(crate) async fn rustdoc_html_server_handler(
474474
})?
475475
.into_canonical_req_version_or_else(|version| {
476476
AxumNope::Redirect(
477-
dbg!(params.clone().with_req_version(version)).rustdoc_url(),
477+
params.clone().with_req_version(version).rustdoc_url(),
478478
CachePolicy::ForeverInCdn,
479479
)
480480
})?;
@@ -3468,7 +3468,9 @@ mod test {
34683468
#[tokio::test(flavor = "multi_thread")]
34693469
async fn test_fetch_item_with_semver_url() -> Result<()> {
34703470
// https://github.com/rust-lang/docs.rs/issues/3036
3471-
3471+
// This fixes an issue where we mistakenly attached a
3472+
// trailing `/` to a rustdoc URL when redirecting
3473+
// to the exact version, coming from a semver version.
34723474
let env = TestEnvironment::new().await?;
34733475

34743476
env.fake_release()

0 commit comments

Comments
 (0)