This commit is contained in:
JMARyA 2024-04-12 09:08:43 +02:00
parent 9dda6fcf7a
commit ff9a0b8691
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

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