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
Allow trailing dot in valid domains #2541
base: devel
Are you sure you want to change the base?
Conversation
Signed-off-by: Christian König <ckoenig@posteo.de>
Just as virtually any DNS software (except maybe for The sole exception from this is the root zone itself My suggestion: Don't simply extend the regular expressions. It will just enable users to add domains that will never be blocked, possibly causing more frustration that the mere fact that this is not possible. A proper fix would likely allow them but also adding some internal logic to strip the trailing dot before doing any processing on them. |
Are there some examples or an issue that this relates to where we can see how this condition happened in the wild? Even Windows |
I've not seen this in the wild. The real world stripping is the reason I opened this PR: "Search Adlists" uses
If you think we should not change the RegEx I can change the processing of the input on "Search Adlist" to stip a trailing dot before executing the search. This would still prevent users from adding |
Edit: |
Please keep branches and PRs focused on one topic only. Don't bikeshed/goldplate please. |
I only added this to that branch because yubiuser asked me to do it a few days ago: My comment was just to show him the code. My branch is still a WIP and I didn't open a PR. I'll remove the code if this is set on another PR. |
What does this PR aim to accomplish?:
We use
validDomain()
in several places (e.g. adding a domain to black/whitelist, querying the adlists). So for, domains with a trailing dot (root zone) were marked as invalid, e.g.www.google.com.
. However, they are valid.How does this PR accomplish the above?:
Appends
\.?
to the validating RegExBy submitting this pull request, I confirm the following:
git rebase
)