From aa691a068add3a29dd06b65d595b633750120eeb Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Mon, 15 Oct 2018 14:31:21 +0300 Subject: [PATCH] Fix #368 --- coredns_plugin/coredns_plugin.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/coredns_plugin/coredns_plugin.go b/coredns_plugin/coredns_plugin.go index 225a9a78..8316d687 100644 --- a/coredns_plugin/coredns_plugin.go +++ b/coredns_plugin/coredns_plugin.go @@ -12,20 +12,16 @@ import ( "sync" "time" + "github.com/AdguardTeam/AdguardDNS/dnsfilter" "github.com/coredns/coredns/core/dnsserver" "github.com/coredns/coredns/plugin" "github.com/coredns/coredns/plugin/metrics" "github.com/coredns/coredns/plugin/pkg/dnstest" "github.com/coredns/coredns/plugin/pkg/upstream" "github.com/coredns/coredns/request" - "github.com/mholt/caddy" - "github.com/miekg/dns" - "github.com/prometheus/client_golang/prometheus" - - "github.com/AdguardTeam/AdguardDNS/dnsfilter" "golang.org/x/net/context" ) @@ -450,7 +446,9 @@ func (p *plug) serveDNSInternal(ctx context.Context, w dns.ResponseWriter, r *dn if err != nil { return rcode, dnsfilter.Result{}, err } - return rcode, dnsfilter.Result{Reason: dnsfilter.FilteredSafeSearch}, err + // TODO: This must be handled in the dnsfilter and not here! + rule := val.String() + " " + host + return rcode, dnsfilter.Result{Reason: dnsfilter.FilteredBlackList, Rule: rule}, err } // needs to be filtered instead