From 820b48fa7acd44c501b6a34b433ec5a3e32121d2 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Sun, 31 Dec 2023 13:52:31 +0300 Subject: [PATCH] Rename name to path in asset serving --- src/routes/assets.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/assets.rs b/src/routes/assets.rs index 31a87d5..48e8a73 100644 --- a/src/routes/assets.rs +++ b/src/routes/assets.rs @@ -59,14 +59,14 @@ static ASSETS: LazyLock> = LazyLock::new(|| { assets }); -#[get("/assets/{name}")] -pub async fn handler(name: web::Path) -> HttpResponse { - let name = name.into_inner(); +#[get("/assets/{path}")] +pub async fn handler(path: web::Path) -> HttpResponse { + let path = path.into_inner(); - if let Some(body) = ASSETS.get(&name) { + if let Some(body) = ASSETS.get(&path) { HttpResponse::Ok() .content_type( - mime_guess::from_path(&name) + mime_guess::from_path(&path) .first_or_octet_stream() .essence_str(), )