Merge pull request #107 in DNS/adguard-dns from fix/460 to master
* commit 'c500345d16586e5a7c917611d52261beac2ac501': Fix #460
This commit is contained in:
commit
d9a65631b9
|
@ -474,6 +474,15 @@ func TestDnsFilterWhitelist(t *testing.T) {
|
||||||
d.checkMatch(t, "example.org")
|
d.checkMatch(t, "example.org")
|
||||||
d.checkMatchEmpty(t, "test.example.org")
|
d.checkMatchEmpty(t, "test.example.org")
|
||||||
d.checkMatchEmpty(t, "test.test.example.org")
|
d.checkMatchEmpty(t, "test.test.example.org")
|
||||||
|
|
||||||
|
d.checkAddRule(t, "||googleadapis.l.google.com^|")
|
||||||
|
d.checkMatch(t, "googleadapis.l.google.com")
|
||||||
|
d.checkMatch(t, "test.googleadapis.l.google.com")
|
||||||
|
|
||||||
|
d.checkAddRule(t, "@@||googleadapis.l.google.com|")
|
||||||
|
d.checkMatchEmpty(t, "googleadapis.l.google.com")
|
||||||
|
d.checkMatchEmpty(t, "test.googleadapis.l.google.com")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDnsFilterImportant(t *testing.T) {
|
func TestDnsFilterImportant(t *testing.T) {
|
||||||
|
|
|
@ -72,6 +72,11 @@ func getSuffix(rule string) (bool, string) {
|
||||||
// last char was checked, eat it
|
// last char was checked, eat it
|
||||||
rule = rule[:len(rule)-1]
|
rule = rule[:len(rule)-1]
|
||||||
|
|
||||||
|
// it might also end with ^|
|
||||||
|
if rule[len(rule)-1] == '^' {
|
||||||
|
rule = rule[:len(rule)-1]
|
||||||
|
}
|
||||||
|
|
||||||
// check that it doesn't have any special characters inside
|
// check that it doesn't have any special characters inside
|
||||||
for _, r := range rule {
|
for _, r := range rule {
|
||||||
switch r {
|
switch r {
|
||||||
|
|
Loading…
Reference in New Issue