From 5b33e4a5662c102002e7865bd19241b4d79fcf21 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 2 Oct 2024 19:34:48 +0300 Subject: [PATCH] notfound-fix --- src/handlers.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/handlers.rs b/src/handlers.rs index 037f2fe..30d2270 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -128,7 +128,13 @@ pub async fn proxy_handler( info!("proxy_handler вызван с путем: {}", path); // весь запрошенный путь - let requested_path = state.get_path(&path).await.unwrap().unwrap(); + let requested_path = match state.get_path(&path).await { + Some(Some(path)) => path, + _ => { + warn!("Путь не найден: {}", path); + return Ok(HttpResponse::NotFound().finish()); + } + }; info!("Запрошенный путь: {}", requested_path); // имя файла