From ad7d1eb7a83508e9666c6fca46e0b6145d849691 Mon Sep 17 00:00:00 2001 From: Snorre Ettrup Altschul Date: Wed, 26 Mar 2025 20:10:53 +0100 Subject: [PATCH] stuff --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index c3089c2..62568fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -239,9 +239,9 @@ fn handle_connection(mut stream: TcpStream) { } Err(e) => match e.kind() { - io::ErrorKind::NotFound => format!("HTTP/1.1 404\r\n\r\n{:?} not found", path.to_str()), - io::ErrorKind::PermissionDenied => format!("HTTP/1.1 403\r\n\r\n{:?} not readable", path.to_str()), - io::ErrorKind::FileTooLarge => format!("HTTP/1.1 413\r\n\r\n{:?} was too large", path.to_str()), + io::ErrorKind::NotFound => format!("HTTP/1.1 404\r\n\r\n{:?} not found", req.file().unwrap().to_str()), + io::ErrorKind::PermissionDenied => format!("HTTP/1.1 403\r\n\r\n{:?} not readable", req.file().unwrap().to_str()), + io::ErrorKind::FileTooLarge => format!("HTTP/1.1 413\r\n\r\n{:?} was too large", req.file().unwrap().to_str()), _ => format!("HTTP/1.1 500{0}{0}{e}", CLRF), }