Remove debug print statements.

This commit is contained in:
abbie 2021-12-26 17:31:46 +00:00
parent 736c1e6546
commit 9f28bcdb84
No known key found for this signature in database
GPG key ID: 04DDE463F9200F87

View file

@ -17,7 +17,6 @@ fn process_cgi(filename: String) -> String {
let vars1 = vars + 1; let vars1 = vars + 1;
query = &filename[vars1..]; query = &filename[vars1..];
script = &filename[..vars]; script = &filename[..vars];
println!("{} {}", query, script);
} else { } else {
query = ""; query = "";
script = &filename; script = &filename;
@ -138,11 +137,9 @@ fn get_page(filename: String) -> String {
if checks == true && index == false { if checks == true && index == false {
if path.contains(".") != true && path.contains(".cgi?") != true { if path.contains(".") != true && path.contains(".cgi?") != true {
let result = generate_index(filename); let result = generate_index(filename);
println!("balls");
return result.to_string(); return result.to_string();
} else if path.contains(".cgi?") { } else if path.contains(".cgi?") {
let result = process_cgi(filename); let result = process_cgi(filename);
println!("quack");
return result.to_string(); return result.to_string();
} }
} }
@ -155,11 +152,9 @@ fn get_page(filename: String) -> String {
return result.to_string(); return result.to_string();
} else if filename.contains(".cgi") { } else if filename.contains(".cgi") {
let result = process_cgi(filename); let result = process_cgi(filename);
println!("cheese");
return result.to_string(); return result.to_string();
} else { } else {
let result = fs::read_to_string(filename); let result = fs::read_to_string(filename);
println!("e");
match result { match result {
Ok(i) => i.to_string(), Ok(i) => i.to_string(),
Err(_e) => "<!DOCTYPE HTML><html><body><h1>403 Forbidden</h1><p>The resource you are trying to access cannot be read by the server.</p></body></html>".to_string(), Err(_e) => "<!DOCTYPE HTML><html><body><h1>403 Forbidden</h1><p>The resource you are trying to access cannot be read by the server.</p></body></html>".to_string(),