summaryrefslogtreecommitdiff
path: root/src/request_handler
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2018-11-26 20:05:09 +0100
committerYves Fischer <yvesf-git@xapek.org>2018-11-26 20:05:09 +0100
commit4a966e386d2a095c3028c758f2bc872fcb3c1e48 (patch)
treeab2ca60a202963c3dad279649dcf99eb6f1f178e /src/request_handler
parent53df864f6d645dc34d4e0d2d16832b53af5789ea (diff)
downloadnginx-auth-totp-4a966e386d2a095c3028c758f2bc872fcb3c1e48.tar.gz
nginx-auth-totp-4a966e386d2a095c3028c758f2bc872fcb3c1e48.zip
Read more than one cookie from headers
Diffstat (limited to 'src/request_handler')
-rw-r--r--src/request_handler/mod.rs6
1 files changed, 4 insertions, 2 deletions
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<Bytes>) -> Result<HeaderExtract, String> {
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 })