Skip to content
Snippets Groups Projects
Commit f9c7b2ac authored by Pratik Lagaskar's avatar Pratik Lagaskar
Browse files

Update blacklist/blacklist.go

parent af540de2
Branches
No related tags found
1 merge request!1Develop-blocker-library
package main
import (
"strings"
"github.com/miekg/dns"
)
var privBlacklist = blacklist.New(httpClient)
func isBlacklisted(req *dns.Msg) bool {
if req.Opcode != dns.OpcodeQuery {
return false
}
if len(req.Question) != 1 {
return false
}
q := req.Question[0]
switch q.Qtype {
case dns.TypeAAAA:
default:
return false
}
return privBlacklist.Contains(strings.TrimRight(q.Name, "."))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment