adblock-rust icon indicating copy to clipboard operation
adblock-rust copied to clipboard

No difference between right anchor and right separator

Open antonok-edm opened this issue 5 years ago • 1 comments

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.

antonok-edm avatar Aug 10 '20 16:08 antonok-edm

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.

antonok-edm avatar Aug 10 '20 19:08 antonok-edm