From 5f42688fbab566973acc8dc414a992819492a9ac Mon Sep 17 00:00:00 2001 From: Dimitry Kolyshev Date: Wed, 10 Apr 2024 09:22:30 +0200 Subject: [PATCH] filtering: imp code --- internal/filtering/safesearch.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/internal/filtering/safesearch.go b/internal/filtering/safesearch.go index 885771a2f0b..57d117b4a60 100644 --- a/internal/filtering/safesearch.go +++ b/internal/filtering/safesearch.go @@ -1,7 +1,5 @@ package filtering -import "github.com/miekg/dns" - // SafeSearch interface describes a service for search engines hosts rewrites. type SafeSearch interface { // CheckHost checks host with safe search filter. CheckHost must be safe @@ -40,13 +38,7 @@ func (d *DNSFilter) checkSafeSearch( qtype uint16, setts *Settings, ) (res Result, err error) { - if !setts.ProtectionEnabled || - !setts.SafeSearchEnabled || - (qtype != dns.TypeA && qtype != dns.TypeAAAA && qtype != dns.TypeHTTPS) { - return Result{}, nil - } - - if d.safeSearch == nil { + if d.safeSearch == nil || !setts.ProtectionEnabled || !setts.SafeSearchEnabled { return Result{}, nil }