Pull request: all: improve dnsrewrite handling
Merge in DNS/adguard-home from 2491-dnsrewrite-log to master
Closes #2491.
Squashed commit of the following:
commit bfe3cb599ed0a921285fb1a6ea27aaefdcc0d093
Merge: 95c5ffe43 15d8f979b
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon Dec 28 18:33:32 2020 +0300
Merge branch 'master' into 2491-dnsrewrite-log
commit 95c5ffe4360b732556455f24b844dad27047e64b
Author: Artem Baskal <a.baskal@adguard.com>
Date: Mon Dec 28 18:11:01 2020 +0300
Add RewriteRule for client
commit b9096c8789009dac1838b542d3409fef54b59aa5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon Dec 28 17:22:44 2020 +0300
all: imp naming, docs
commit 4e00de0d613e4740451e4c8eb5a1de35a70a5896
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon Dec 28 17:16:35 2020 +0300
all: imp naming, add todo
commit 67e4045f627a9569f382309705963640dcf3454a
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon Dec 28 16:53:00 2020 +0300
all: improve dnsrewrite handling
This commit is contained in:
@@ -116,8 +116,9 @@ func (c *searchCriteria) ctFilteringStatusCase(res dnsfilter.Result) bool {
|
||||
return res.IsFiltered ||
|
||||
res.Reason.In(
|
||||
dnsfilter.NotFilteredAllowList,
|
||||
dnsfilter.ReasonRewrite,
|
||||
dnsfilter.RewriteAutoHosts,
|
||||
dnsfilter.Rewritten,
|
||||
dnsfilter.RewrittenAutoHosts,
|
||||
dnsfilter.RewrittenRule,
|
||||
)
|
||||
|
||||
case filteringStatusBlocked:
|
||||
@@ -137,7 +138,11 @@ func (c *searchCriteria) ctFilteringStatusCase(res dnsfilter.Result) bool {
|
||||
return res.Reason == dnsfilter.NotFilteredAllowList
|
||||
|
||||
case filteringStatusRewritten:
|
||||
return res.Reason.In(dnsfilter.ReasonRewrite, dnsfilter.RewriteAutoHosts)
|
||||
return res.Reason.In(
|
||||
dnsfilter.Rewritten,
|
||||
dnsfilter.RewrittenAutoHosts,
|
||||
dnsfilter.RewrittenRule,
|
||||
)
|
||||
|
||||
case filteringStatusSafeSearch:
|
||||
return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch
|
||||
|
||||
Reference in New Issue
Block a user