Make domain matches in the dns.spoof module case insensitive

This commit is contained in:
DoI 2020-07-02 19:33:47 +12:00
commit ef27a79ec3

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