brave-experiments / ad-block

Ad block engine used in the Brave browser for ABP filter syntax based lists like EasyList.
https://www.brave.com
Mozilla Public License 2.0
239 stars 95 forks source link

Fix domain matching logic #162

Closed bbondy closed 5 years ago

bbondy commented 5 years ago

Domain matching logic was complex and didn't work in all cases. This caused us to miss an exception allow rule from: https://github.com/brave/brave-browser/issues/2843

This rewrites the domain matching logic to be much faster on checks, but use a bit more memory.

Note that domain matching code is well tested already before this PR, so there's a lot of tests which ensure the safety of this change. New tests were also added to cover the new cases.