Skip to content

Commit

Permalink
filtering: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed Apr 10, 2024
1 parent eb9bd9f commit 5f42688
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/filtering/safesearch.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 5f42688

Please sign in to comment.