mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Add mach command to update public domain list and use a HashSet instead of a Vec to lookup public domains
This commit is contained in:
parent
04b682195d
commit
dbef65129f
8 changed files with 8134 additions and 5962 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
use cookie_rs;
|
||||
use net_traits::CookieSource;
|
||||
use pub_domains::PUB_DOMAINS;
|
||||
use pub_domains::is_pub_domain;
|
||||
use std::borrow::ToOwned;
|
||||
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||
use time::{Tm, now, at, Duration};
|
||||
|
@ -45,10 +45,12 @@ impl Cookie {
|
|||
let mut domain = cookie.domain.clone().unwrap_or("".to_owned());
|
||||
|
||||
// Step 5
|
||||
match PUB_DOMAINS.iter().find(|&x| domain == *x) {
|
||||
Some(val) if *val == url_host => domain = "".to_owned(),
|
||||
Some(_) => return None,
|
||||
None => {}
|
||||
if is_pub_domain(&domain) {
|
||||
if domain == url_host {
|
||||
domain = "".to_owned();
|
||||
} else {
|
||||
return None
|
||||
}
|
||||
}
|
||||
|
||||
// Step 6
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue