From 6ebd18d1e015f99a6275b802afb64fadc29ecf88 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Sun, 30 May 2021 17:01:14 +0200 Subject: [PATCH] Return not found when a cookie is empty --- app/src/cookies.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/cookies.rs b/app/src/cookies.rs index e6469df..f3462d5 100644 --- a/app/src/cookies.rs +++ b/app/src/cookies.rs @@ -39,7 +39,11 @@ pub fn get_cookie(cookie_name: &str) -> Result> { .filter_map(|c| c.split_once('=')) .find_map(|(name, value)| { if name == cookie_name { - Some(value.to_string()) + if value.is_empty() { + None + } else { + Some(value.to_string()) + } } else { None }