And the resource has been isolated!
This commit is contained in:
parent
cf0066abce
commit
0ef8e438db
2 changed files with 11 additions and 7 deletions
|
@ -22,7 +22,7 @@ The stuff I need to make it usable.
|
|||
|
||||
[x] Read the stream
|
||||
|
||||
[ ] Detect which resource the client wants to access
|
||||
[x] Detect which resource the client wants to access
|
||||
|
||||
[ ] Detect missing files and return a 404 page
|
||||
|
||||
|
@ -32,7 +32,7 @@ The stuff I need to make it usable.
|
|||
|
||||
[ ] Properly generate headers
|
||||
|
||||
[ ] Read other pages from filesystem
|
||||
[ ] Read and serve other pages from filesystem
|
||||
|
||||
### SUPAR Chonklist
|
||||
Whatever is on here, just to make it extra spicy.
|
||||
|
|
14
src/main.rs
14
src/main.rs
|
@ -35,18 +35,22 @@ fn process_request(request: Vec<u8>) -> String {
|
|||
|
||||
if input == "/" {
|
||||
// And now for ignoring the entire variable!
|
||||
output = "index.html".to_string();
|
||||
output = "index.html"
|
||||
} else {
|
||||
output = "index.html".to_string();
|
||||
let mut chars = input.chars();
|
||||
chars.next();
|
||||
output = chars.as_str();
|
||||
}
|
||||
|
||||
} else {
|
||||
// It's get_page()'s problem now.
|
||||
println!("Stream sent unhandlable request type.");
|
||||
output = ".503".to_string();
|
||||
output = ".503"
|
||||
}
|
||||
println!("{}", output);
|
||||
return output;
|
||||
println!("{}", output.to_string());
|
||||
|
||||
// Did you want to see chars.as_str().to_string()?
|
||||
return output.to_string();
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue