Merge pull request #752 from denandz/master

Make domain matches in the dns.spoof module case insensitive
This commit is contained in:
Simone Margaritelli 2020-07-03 14:25:03 +02:00 committed by GitHub
commit b1381568d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,7 +22,8 @@ type HostEntry struct {
}
func (e HostEntry) Matches(host string) bool {
return e.Host == host || strings.HasSuffix(host, e.Suffix) || (e.Expr != nil && e.Expr.Match(host))
lowerHost := strings.ToLower(host)
return e.Host == lowerHost || strings.HasSuffix(lowerHost, e.Suffix) || (e.Expr != nil && e.Expr.Match(lowerHost))
}
type Hosts []HostEntry