From 4a966e386d2a095c3028c758f2bc872fcb3c1e48 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Mon, 26 Nov 2018 20:05:09 +0100 Subject: Read more than one cookie from headers --- src/request_handler/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/request_handler/mod.rs') diff --git a/src/request_handler/mod.rs b/src/request_handler/mod.rs index 4a01af6..2e92821 100644 --- a/src/request_handler/mod.rs +++ b/src/request_handler/mod.rs @@ -162,8 +162,10 @@ fn parse_header_infos(req: &Request) -> Result { let mut cookies = Vec::new(); for header_value in req.headers().get_all(::http::header::COOKIE) { let value = header_value.to_str().or(Err("Failed to read cookie value"))?; - let cookie = Cookie::parse(value).or(Err("Failed to parse cookie value"))?; - cookies.push(cookie); + for cookie_part in value.split("; ") { + let cookie = Cookie::parse(cookie_part).or(Err("Failed to parse cookie value"))?; + cookies.push(cookie); + } } Ok(HeaderExtract { totp_secrets, cookies }) -- cgit v1.2.1