Skip to content
Snippets Groups Projects
Select Git revision
  • 7992cd0d51c3b858f36e74abd76ceef986b51df8
  • master default protected
  • add-metadata-cleaner-link
  • fix-key-error-for-svg-without-xmlns
  • factorize
  • ppt
  • patch-1
  • pdf_depth
  • fix_testsuite
  • add_wav_support
  • please_mypy
  • improve_zip
  • improve_images
  • improve_svg
  • inverted_backup
  • bak
  • elementary-contract
  • implement_lightweight_mode_msoffice
  • 0.11.0
  • 0.10.1
  • 0.10.0
  • 0.9.0
  • 0.8.0
  • 0.7.0
  • 0.6.0
  • 0.5.0
  • 0.4.0
  • 0.3.1
  • 0.3.0
  • 0.2.0
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0
34 results

main.py

Blame
  • Forked from jvoisin / mat2
    Source project has a limited visibility.
    blacklist.go 441 B
    package main
    
    import (
    	"strings"
    	"main/blacklist"
    	"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.TypeA:
    	case dns.TypeAAAA:
    	default:
    		return false
    	}
    
    	return privBlacklist.Contains(strings.TrimRight(q.Name, "."))
    }