From 4e0078e7bac5a8b3e7e267a1562590d1300dac64 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Wed, 5 Jun 2024 20:55:59 +0300 Subject: feat: Added basic handling of Content-Encoding header --- src/request.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/request.rs') 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> 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::() .expect("Content-Length should be parsable to usize"); -- cgit v1.2.3