Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mach command to update public domain list and use a HashSet for matching #11513

Merged
merged 1 commit into from Jun 9, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Add mach command to update public domain list and use a HashSet inste…

…ad of a Vec to lookup public domains
  • Loading branch information
fduraffourg committed Jun 9, 2016
commit dbef65129f40ce6ca0e8ee7e520ec366c1c7577e
@@ -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
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.