commit ca858423694ba9c2201f333ad3a6dc816c54763b parent eaebcb20460d01a29d191b933d3737973f2f2321 Author: Matt Brubeck <mbrubeck@limpet.net> Date: Thu, 21 May 2020 09:35:43 -0700 Fix error response codes Diffstat:
M | src/main.rs | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main.rs b/src/main.rs @@ -76,12 +76,12 @@ async fn connection(stream: TcpStream) -> Result { let mut stream = ACCEPTOR.accept(stream).await?; match parse_request(&mut stream).await { Err(e) => { - stream.write_all(b"50 Invalid request.\r\n").await?; + stream.write_all(b"59 Invalid request.\r\n").await?; Err(e) } Ok(url) => match get(&url).await { Err(e) => { - stream.write_all(b"40 Not found, sorry.\r\n").await?; + stream.write_all(b"51 Not found, sorry.\r\n").await?; Err(e) } Ok(response) => {