-
Notifications
You must be signed in to change notification settings - Fork 280
[AG-31991] Remove complicated heuristics for $domain modifier #677
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
base: master
Are you sure you want to change the base?
Conversation
Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/ |
@workingBanana We need to retain info about deprecated behavior, but note that since CoreLibs 1.18 logic is simplified. Examples should mention both cases, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented separately
Now that we have the `$to` modifier, `$domain` will no longer match the target domain by default - only when the `$csp` or `$cookie` modifiers are specified. See-also: AG-31991 Signed-off-by: Alexey Zhavoronkov <[email protected]>
137d503
to
83eaea6
Compare
Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/ |
Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/ |
Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add $removeparam
Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/ |
|
||
**Examples** | ||
|
||
- `*$cookie,domain=example.org|example.com` will block cookies for all requests to and from `example.org` and `example.com`. | ||
- `*$document,domain=example.org|example.com` will block all requests to and from `example.org` and `example.com`. | ||
- `*$document,domain=example.org|example.com` will block requests only from `example.org` and `example.com` but not to them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `*$document,domain=example.org|example.com` will block requests only from `example.org` and `example.com` but not to them. | |
- `*$document,domain=example.org|example.com` will block requests only from `example.org` and `example.com`, but not to them. |
- `page$domain=targetdomain.com` will be matched, as it matches the target domain and satisfies all requirements mentioned above. | ||
- `||*page$domain=targetdomain.com` will not be matched, as the pattern `||*page` may match specific domains, | ||
e.g. `example.page`. | ||
- `page$domain=targetdomain.com` will not be matched, as it does not match referrer domain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `page$domain=targetdomain.com` will not be matched, as it does not match referrer domain. | |
- `page$domain=targetdomain.com` will not be matched because it does not match the referrer domain. |
If some of the conditions above are not met but the rule contains [`$cookie`](#cookie-modifier) or [`$csp`](#csp-modifier) modifier, the target domain will still be matched. | ||
|
||
If the referrer matches a rule with `$domain` that explicitly excludes the referrer domain, then the rule will not be applied even if the target domain also matches the rule. This affects rules with [`$cookie`](#cookie-modifier) and [`$csp`](#csp-modifier) modifiers, too. | ||
For these modifiers, if the referrer matches a rule with `$domain` that explicitly excludes the referrer domain, then the rule will not be applied even if the target domain also matches the rule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these modifiers, if the referrer matches a rule with `$domain` that explicitly excludes the referrer domain, then the rule will not be applied even if the target domain also matches the rule. | |
These modifiers will not be applied if the referrer matches a rule with `$domain` that explicitly excludes the referrer domain, even if the target domain also matches the rule. |
Now that we have the
$to
modifier,$domain
will no longer match the target domain by default - only when the$csp
or$cookie
modifiers are specified.Target CoreLibs version is 1.18