log not found paths and forbidden methods
This commit is contained in:
+2
-2
@@ -66,13 +66,13 @@ async fn process_socket(mut socket: BufStream<TcpStream>, urlmap: Arc<HashMap<St
|
||||
let path = normalise_path(path);
|
||||
|
||||
if http_method != "GET" {
|
||||
println!("process_request: forbidden method");
|
||||
println!("process_request: forbidden method: http_method={http_method}");
|
||||
simple_response(socket, ResponseCode::Forbidden).await;
|
||||
return;
|
||||
}
|
||||
|
||||
let Some(location) = urlmap.get(&path) else {
|
||||
println!("process_request: not found");
|
||||
println!("process_request: not found: location={path}");
|
||||
simple_response(socket, ResponseCode::NotFound).await;
|
||||
return;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user