allow slash after file url

This commit is contained in:
neri 2021-04-07 13:02:46 +02:00
parent dbafc1849e
commit 1c43d70457
1 changed files with 6 additions and 2 deletions

View File

@ -54,7 +54,11 @@ 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}"])
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))