Correct cookie handling behavior

- Cookies with empty values are not to be ignored as per RFC6265
- A space should separate two cookie-pairs as per RFC6265 section
  4.2.1
This commit is contained in:
Florian Duraffourg 2016-05-17 10:13:47 +02:00
parent 8b9b36454c
commit 4fb53c8256

View file

@ -58,10 +58,6 @@ impl CookieStorage {
return;
}
if cookie.cookie.value.is_empty() {
return;
}
// Step 11
if let Some(old_cookie) = old_cookie.unwrap() {
// Step 11.3
@ -108,7 +104,7 @@ impl CookieStorage {
// Step 4
(match acc.len() {
0 => acc,
_ => acc + ";"
_ => acc + "; "
}) + &c.cookie.name + "=" + &c.cookie.value
};
let result = url_cookies.iter_mut().fold("".to_owned(), reducer);