fix search by "whitelisted", "rewritten"

This commit is contained in:
Simon Zolin 2020-06-16 11:47:26 +03:00
parent b6052a4cd1
commit 15e714350c
1 changed files with 7 additions and 5 deletions

View File

@ -101,7 +101,10 @@ func (c *searchCriteria) match(entry *logEntry) bool {
case filteringStatusAll: case filteringStatusAll:
return true return true
case filteringStatusFiltered: case filteringStatusFiltered:
return res.IsFiltered return res.IsFiltered ||
res.Reason == dnsfilter.NotFilteredWhiteList ||
res.Reason == dnsfilter.ReasonRewrite ||
res.Reason == dnsfilter.RewriteEtcHosts
case filteringStatusBlocked: case filteringStatusBlocked:
return res.IsFiltered && return res.IsFiltered &&
(res.Reason == dnsfilter.FilteredBlackList || (res.Reason == dnsfilter.FilteredBlackList ||
@ -111,10 +114,9 @@ func (c *searchCriteria) match(entry *logEntry) bool {
case filteringStatusBlockedSafebrowsing: case filteringStatusBlockedSafebrowsing:
return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeBrowsing return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeBrowsing
case filteringStatusWhitelisted: case filteringStatusWhitelisted:
return res.IsFiltered && res.Reason == dnsfilter.NotFilteredWhiteList return res.Reason == dnsfilter.NotFilteredWhiteList
case filteringStatusRewritten: case filteringStatusRewritten:
return res.IsFiltered && return (res.Reason == dnsfilter.ReasonRewrite ||
(res.Reason == dnsfilter.ReasonRewrite ||
res.Reason == dnsfilter.RewriteEtcHosts) res.Reason == dnsfilter.RewriteEtcHosts)
case filteringStatusSafeSearch: case filteringStatusSafeSearch:
return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch