diff --git a/dnscrypt-proxy/plugin_block_name.go b/dnscrypt-proxy/plugin_block_name.go index 474feb82..82ab9769 100644 --- a/dnscrypt-proxy/plugin_block_name.go +++ b/dnscrypt-proxy/plugin_block_name.go @@ -181,20 +181,20 @@ func (plugin *PluginBlockNameResponse) Eval(pluginsState *PluginsState, msg *dns answers := msg.Answer for _, answer := range answers { header := answer.Header() - var target string - var err error if header.Class != dns.ClassINET { continue } + var target string if header.Rrtype == dns.TypeCNAME { - target, err = NormalizeQName(answer.(*dns.CNAME).Target) + target = answer.(*dns.CNAME).Target } else if header.Rrtype == dns.TypeSVCB && answer.(*dns.SVCB).Priority == 0 { - target, err = NormalizeQName(answer.(*dns.SVCB).Target) + target = answer.(*dns.SVCB).Target } else if header.Rrtype == dns.TypeSVCB && answer.(*dns.HTTPS).Priority == 0 { - target, err = NormalizeQName(answer.(*dns.HTTPS).Target) + target = answer.(*dns.HTTPS).Target } else { continue } + target, err := NormalizeQName(target) if err != nil { return err }