adblock-rust
adblock-rust copied to clipboard
No difference between right anchor and right separator
Currently there is no difference between trailing ^ and | characters on network rules, e.g. the parsed version fo the ||gateway.reddit.com| rule from EasyPrivacy is indistinguishable from a hypothetical ||gateway.reddit.com^ rule.
A request to https://gateway.reddit.com/example.html should be allowed by the first rule and blocked by the second. Currently both rules block this request.
The issue here stems from overloading the IS_RIGHT_ANCHOR flag to apply in both situations. There should be separate ways of indicating that the end of a filter pattern must match the end of the URL, and that the hostname from a rule contains its complete TLD.