Skip to content

Commit b37bf89

Browse files
committed
Fixed: Fix the issue of diango_lang being filtered out.
1 parent 0a498c2 commit b37bf89

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src-tauri/src/utils.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,17 @@ pub async fn get_window_cookies(
6666
if target_is_ip {
6767
return true;
6868
}
69-
let domain = cookie.domain().unwrap_or("");
69+
70+
let domain_opt = cookie.domain();
71+
let domain = domain_opt.unwrap_or("");
7072
let cd = domain.trim_start_matches('.');
7173
let td = target_domain.as_str();
7274

7375
let exact_or_subdomain =
7476
!cd.is_empty() && (cd == td || cd.ends_with(&format!(".{}", td)) || td.ends_with(&format!(".{}", cd)));
77+
let host_only_cookie = domain_opt.is_none() && !td.is_empty();
7578

76-
let ip_cookie_without_domain = cd.is_empty() && target_is_ip;
77-
78-
exact_or_subdomain || ip_cookie_without_domain
79+
exact_or_subdomain || host_only_cookie
7980
})
8081
.collect();
8182

0 commit comments

Comments
 (0)