Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/filters/network_matchers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ pub fn check_included_domains_mapped(
}) {
return false;
}
} else {
// If there are domain restrictions but no source hostname, we can't apply the rule
return false;
}
}
true
Expand Down Expand Up @@ -485,6 +488,10 @@ pub fn check_excluded_domains_mapped(
}) {
return false;
}
} else {
// If there are domain restrictions but no source hostname
// (i.e. about:blank), apply the rule anyway.
return true;
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@ fn check_rule_matching_browserlike() {
let (blocked, passes) = bench_rule_matching_browserlike(&engine, &requests);
let msg = "The number of blocked/passed requests has changed. ".to_string()
+ "If this is expected, update the expected values in the test.";
assert_eq!((blocked, passes), (101701, 141244), "{msg}");
assert_eq!((blocked, passes), (106860, 136085), "{msg}");
}