CookieJar iter return &Cookie now

This commit is contained in:
2023-03-27 11:18:28 +00:00
committed by GitHub
parent f80fd2efae
commit e29362d80f
2 changed files with 35 additions and 20 deletions

View File

@@ -1,5 +1,4 @@
use crate::cookies::Cookie;
use crate::cookies::CookieJarLine;
use crate::cookies::ManagedCookieJar;
use crate::ext::atomic::AtomicQuick;
use crate::ext::json::ToJson;
@@ -64,16 +63,11 @@ pub fn gen_cookie_header<U: IntoUrl>(c: &WebClient, url: U) -> String {
let mut s = String::from("");
let u = url.as_str();
for a in c.get_cookies().jar.get_ref().iter() {
match a {
CookieJarLine::Cookie(a) => {
if a.matched(u) {
if s.len() > 0 {
s += " ";
}
s += a.get_name_value().as_str();
}
if a.matched(u) {
if s.len() > 0 {
s += " ";
}
_ => {}
s += a.get_name_value().as_str();
}
}
s