Exemple #1
0
func isPossiblyInternal(addr string) bool {
	// note: this happens to reject IPs and anything with a port at the end.
	_, icann := publicsuffix.PublicSuffix(addr)
	if !icann {
		log.Printf("%s does not have a public suffix", addr)
		return true
	}
	if internal_re.MatchString(addr) {
		log.Printf("%s may be internal.", addr)
		return true
	}
	return false
}
Exemple #2
0
func (psl *myPublicSuffixList) PublicSuffix(domain string) string {
	suffix, _ := publicsuffix.PublicSuffix(domain)
	return suffix
}