From 5afcad16b2b807e9c00e98c57db528d8b45cc4e5 Mon Sep 17 00:00:00 2001 From: Denis Cornehl Date: Sat, 24 Dec 2022 22:16:01 +0100 Subject: [PATCH] re-add & modify test for double-shash at the end of routes --- src/web/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/web/mod.rs b/src/web/mod.rs index 880c4a5a9..ee7545b84 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -660,6 +660,21 @@ mod test { }) } + #[test] + fn double_slash_does_redirect_and_remove_slash() { + wrapper(|env| { + env.fake_release() + .name("bat") + .version("0.2.0") + .create() + .unwrap(); + let web = env.frontend(); + let response = web.get("/bat//").send()?; + assert_eq!(response.status(), StatusCode::NOT_FOUND); + Ok(()) + }) + } + #[test] fn binary_docs_redirect_to_crate() { wrapper(|env| {