From 1c43d704572e6d03a5fcd84f62eee9b85956707b Mon Sep 17 00:00:00 2001 From: neri Date: Wed, 7 Apr 2021 13:02:46 +0200 Subject: [PATCH] allow slash after file url --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 23ab8ce..1b2a5a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -54,8 +54,12 @@ async fn main() -> std::io::Result<()> { ) .service(Files::new("/static", "static").disable_content_disposition()) .service( - web::resource(["/{id:[a-z0-9]{5}}", "/{id:[a-z0-9]{5}}/{name}"]) - .route(web::get().to(download::download)), + web::resource([ + "/{id:[a-z0-9]{5}}", + "/{id:[a-z0-9]{5}}/", + "/{id:[a-z0-9]{5}}/{name}", + ]) + .route(web::get().to(download::download)), ) .default_service(web::route().to(not_found)) }