From 9f9130698bbaf1dfa8c5a89a958d752d3917cf88 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Tue, 26 Mar 2024 20:11:16 +0100 Subject: [PATCH] accept requests using only linefeeds --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5c4ed0d..d66cd5b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,7 +65,7 @@ fn handle_connection(mut stream: TcpStream) { println!("[{client_ip}] request over {MAX_REQUEST_SIZE} bytes, closing connection"); return; } - if buffer.ends_with(b"\r\n\r\n") { + if buffer.ends_with(b"\r\n\r\n") || buffer.ends_with(b"\n\n") { let request = String::from_utf8_lossy(&buffer).to_string(); println!("[{client_ip}] received {} bytes", buffer.len());