diff --git a/Cargo.lock b/Cargo.lock index 2acb580..f355ef0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "starfig" -version = "0.1.1" +version = "0.1.2" dependencies = [ "native-tls", "packeteer", diff --git a/Cargo.toml b/Cargo.toml index e88ef6b..66d79aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starfig" -version = "0.1.1" +version = "0.1.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index c96ad47..531ff89 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,7 +44,13 @@ fn serve(mut stream: TlsStream) { if file == "# 51 Not Found\nThe resource you were looking for couldn't be found :(\nStarfig, gemini server by threeoh6000" { res.code = 51; } - res.meta = "text/gemini".to_string(); + if res.code == 20 { + res.meta = "text/gemini".to_string(); + } else if res.code == 51 { + res.meta = "Not Found".to_string(); + } else { + res.meta = "Err".to_string(); + } let (res_head, res_bod) = unpack_response(res); stream.write(res_head.as_bytes()).unwrap(); stream.flush().unwrap();