aboutsummaryrefslogtreecommitdiff
path: root/src/request.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/request.rs')
-rw-r--r--src/request.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/request.rs b/src/request.rs
index aed69e5..7c8f43c 100644
--- a/src/request.rs
+++ b/src/request.rs
@@ -24,8 +24,8 @@ impl Request {
}
}
- pub fn get_tag(&self, key: String) -> String {
- self.headers.as_ref().unwrap().0.get(&key).unwrap().clone()
+ pub fn get_tag(&self, key: &str) -> Option<&String> {
+ self.headers.as_ref().unwrap().0.get(&key.to_string())
}
pub fn method(&self) -> &Method {
@@ -48,7 +48,6 @@ impl From<Vec<&str>> for Request {
let (method, headers, body) =
(Method::from(*request_line), Headers::from(headers), body);
if let Some(content_length) = headers.0.get("Content-Length") {
- println!("Well hello there");
let content_length = content_length
.parse::<usize>()
.expect("Content-Length should be parsable to usize");