add support for hyphen separated wildcard domains#246
add support for hyphen separated wildcard domains#246marriva wants to merge 1 commit intoAdguardTeam:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #246 +/- ##
==========================================
+ Coverage 70.21% 70.23% +0.01%
==========================================
Files 39 39
Lines 2377 2392 +15
==========================================
+ Hits 1669 1680 +11
- Misses 509 512 +3
- Partials 199 200 +1
Continue to review full report at Codecov.
|
ameshkov
left a comment
There was a problem hiding this comment.
Hi, thank you for the contribution!
Could you please also add unit-tests for that?
Sample configurations for the test:
conf := []string{
"0.0.0.1",
"[/a.x/]0.0.0.2",
"[/*-b.a.x/]0.0.0.3",
"[/b.a.x/]0.0.0.4",
"[/*-c.b.a.x/]0.0.0.5",
"[/c.b.a.x/]#",
}
conf := []string{
"0.0.0.1",
"[/a.x/]0.0.0.2",
"[/*.a.x/]0.0.0.3",
"[/*-b.a.x/]0.0.0.4",
"[/b.a.x/]0.0.0.5",
}
"[/*-a.b.c/]0.0.0.1",
"[/*-.b.c/]0.0.0.2",
"[/*.b-x.c/]0.0.0.3"
|
@marriva, hello. The Dnsmasq's documentation states:
AFAIK, it doesn't apply any special handling for domains (and patterns) with hyphens. As per the man page, Dnsmasq supports the following wildcard pattern types:
Thus the PR seems a bit incomplete in terms of adding support for the last pattern type since it only handles the @ameshkov, what do you think? |
Hello!
Please add support for wildcards separated by a hyphen as in dnsmasq.
For example,
*-dev.example.organd*-prod.example.orgI need to use different upstreams for
something-dev.example.organdsomething-prod.example.org