Convert domain names to lowercase before matching (#195)

Co-authored-by: RPRX <63339210+rprx@users.noreply.github.com>
This commit is contained in:
Arthur MorganandRPRX authored and GitHub committed 2021-01-21 23:37:55 +00:00
1 parent 0b4858d016
commit 5aa053a65f
5 files changed
+7 -2

No files matched your search

+1
View File
@@ -364,6 +364,7 @@ func (s *Server) lookupIPInternal(domain string, option IPOption) ([]net.IP, err
if domain == "" {
return nil, newError("empty domain name")
}
domain = strings.ToLower(domain)
// normalize the FQDN form query
if domain[len(domain)-1] == '.' {
+1 -1
View File
@@ -91,7 +91,7 @@ func (m *DomainMatcher) Apply(ctx routing.Context) bool {
if len(domain) == 0 {
return false
}
return m.ApplyDomain(domain)
return m.ApplyDomain(strings.ToLower(domain))
}
type MultiGeoIPMatcher struct {