0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-12 11:29:36 +03:00

Convert domain names to lowercase before matching (#195)

Co-authored-by: RPRX <63339210+rprx@users.noreply.github.com>
This commit is contained in:
Arthur Morgan
2021-01-22 07:37:55 +08:00
committed by GitHub
parent 0b4858d016
commit 5aa053a65f
5 changed files with 7 additions and 2 deletions

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] == '.' {

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 {