Add User-Agent Path, Parse request through
User-Agent Header
Change-Id: Idf91f1ab6b0e29e5e298aaafd508a0fc0949b42a
Reviewed-on: https://git.clicks.codes/c/Clicks/BYO/HttpServer/rust/+/254
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/src/main.rs b/src/main.rs
index 3d6e61a..3b23e05 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -33,7 +33,7 @@
request.insert("method".to_owned(), splits.next().unwrap().to_owned());
request.insert("path".to_owned(), splits.next().unwrap().to_owned());
} else {
- let mut splits = line.split(':');
+ let mut splits = line.split(": ");
let key = splits.next().unwrap();
let value = splits.next().unwrap();
request.insert(key.to_owned(), value.to_owned());
@@ -43,7 +43,7 @@
line_num += 1;
}
- // println!("{:?}", request);
+ println!("{:?}", request);
let mut path = request.get("path").unwrap().split("/");