Skip to content

Commit 701936e

Browse files
committed
Display 404 Page per default, bump version to 1.1.0
1 parent cfe64c6 commit 701936e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
2-
name = "ErrorServer"
3-
version = "1.0.0"
2+
name = "error_server"
3+
version = "1.1.0"
44
edition = "2021"
55
repository = "https://github.com/SIMULATAN/ErrorServer"
66

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn handle_connection(mut stream: TcpStream, file_contents: &String, regex: &Rege
3232
.collect();
3333

3434
let request_line = http_request.get(0).unwrap();
35-
let status_code = regex.captures_iter(&request_line).next().unwrap().get(1).unwrap().as_str().parse::<u16>().unwrap_or(1);
35+
let status_code = regex.captures_iter(&request_line).next().unwrap().get(1).unwrap().as_str().parse::<u16>().unwrap_or(404);
3636

3737
let status_code_str = if status_code == 1 {"".to_string()} else {status_code.to_string()};
3838
let content = file_contents

0 commit comments

Comments
 (0)