Remove debug messages as I went insane trying to fix the tiny CRLF problem in process_request()
This commit is contained in:
parent
3f85e46d01
commit
00ebb833aa
1 changed files with 2 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
use std::io::{Write, BufReader, BufRead};
|
se std::io::{Write, BufReader, BufRead};
|
||||||
use std::net::{TcpListener, TcpStream};
|
use std::net::{TcpListener, TcpStream};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::string::{String};
|
use std::string::{String};
|
||||||
|
@ -13,7 +13,6 @@ fn get_page(filename: String) -> String {
|
||||||
|
|
||||||
return result.to_string();
|
return result.to_string();
|
||||||
} else {
|
} else {
|
||||||
println!("Read");
|
|
||||||
let result = fs::read_to_string(filename);
|
let result = fs::read_to_string(filename);
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
|
@ -29,7 +28,7 @@ fn process_request(request: Vec<u8>) -> String {
|
||||||
let output;
|
let output;
|
||||||
if input.contains("GET") {
|
if input.contains("GET") {
|
||||||
// To-do: find a less atrocious way to do this.
|
// To-do: find a less atrocious way to do this.
|
||||||
println!("Stream sent GET request.");
|
println!("Stream sent GET request.");
|
||||||
input = input.replace("GET ", "");
|
input = input.replace("GET ", "");
|
||||||
input = input.replace(" HTTP/1.1\r\n", "");
|
input = input.replace(" HTTP/1.1\r\n", "");
|
||||||
// Theoretically by this point, the request
|
// Theoretically by this point, the request
|
||||||
|
@ -43,7 +42,6 @@ fn process_request(request: Vec<u8>) -> String {
|
||||||
let mut chars = input.chars();
|
let mut chars = input.chars();
|
||||||
chars.next();
|
chars.next();
|
||||||
output = chars.as_str();
|
output = chars.as_str();
|
||||||
println!("CHARS");
|
|
||||||
} else {
|
} else {
|
||||||
output = "index.html";
|
output = "index.html";
|
||||||
}
|
}
|
||||||
|
@ -54,7 +52,6 @@ fn process_request(request: Vec<u8>) -> String {
|
||||||
println!("Stream sent unhandlable request type.");
|
println!("Stream sent unhandlable request type.");
|
||||||
output = ".503";
|
output = ".503";
|
||||||
}
|
}
|
||||||
println!("{}", output.to_string());
|
|
||||||
|
|
||||||
// Did you want to see chars.as_str().to_string()?
|
// Did you want to see chars.as_str().to_string()?
|
||||||
return output.to_string();
|
return output.to_string();
|
||||||
|
|
Loading…
Reference in a new issue