Update lib.rs

This commit is contained in:
Werner
2021-12-11 17:29:19 -03:00
parent b037e195e2
commit 50e9e4a5d4

View File

@ -10,7 +10,7 @@ pub fn HandleConnection(mut stream: TcpStream) {
let get = b"GET / HTTP/1.1\r\n";
let (status_line, filename) = if buffer.starts_with(get) {
let (status, filename) = if buffer.starts_with(get) {
("HTTP/1.1 200 OK", "Hello.html")
} else {
("HTTP/1.1 404 NOT FOUND", "404.html")
@ -20,7 +20,7 @@ pub fn HandleConnection(mut stream: TcpStream) {
let response = format!(
"{}\r\nContent-Length: {}\r\n\r\n{}",
status_line,
status,
contents.len(),
contents,
);