mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-04-14 23:48:05 +08:00
fix ch20-web-server/listing-20-09/src code error
This commit is contained in:
parent
a4d67c2354
commit
21c40e8fa0
@ -26,7 +26,7 @@ fn handle_connection(mut stream: TcpStream) {
|
|||||||
let get = b"GET / HTTP/1.1\r\n";
|
let get = b"GET / HTTP/1.1\r\n";
|
||||||
|
|
||||||
// ANCHOR: here
|
// ANCHOR: here
|
||||||
let (status_line, filename) = if buffer.starts_with(get) {
|
let (status_line, filename) = if buffer.starts_with("GET".as_bytes()) {
|
||||||
("HTTP/1.1 200 OK", "hello.html")
|
("HTTP/1.1 200 OK", "hello.html")
|
||||||
} else {
|
} else {
|
||||||
("HTTP/1.1 404 NOT FOUND", "404.html")
|
("HTTP/1.1 404 NOT FOUND", "404.html")
|
||||||
|
Loading…
Reference in New Issue
Block a user