diff --git a/src/main.rs b/src/main.rs index 79880d0..56e9040 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use actix_web::{web, App, HttpRequest, HttpServer, Responder}; +use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer, Responder}; mod config; mod proxy; use proxy::Mirror; @@ -8,7 +8,7 @@ async fn index(req: HttpRequest) -> impl Responder { let p: &actix_web::web::Data = req.app_data().unwrap(); let data = p.get(path, &req).await; - data.unwrap() + data.unwrap_or_else(|| HttpResponse::NotFound().finish()) } #[actix_web::main]