Przeglądaj źródła

ignore domain case in route rules

Dmitry R 2 lat temu
rodzic
commit
5d41e328d4

+ 1 - 1
route/rule_domain.go

@@ -53,7 +53,7 @@ func (r *DomainItem) Match(metadata *adapter.InboundContext) bool {
 	if domainHost == "" {
 		return false
 	}
-	return r.matcher.Match(domainHost)
+	return r.matcher.Match(strings.ToLower(domainHost))
 }
 
 func (r *DomainItem) String() string {

+ 1 - 0
route/rule_domain_keyword.go

@@ -26,6 +26,7 @@ func (r *DomainKeywordItem) Match(metadata *adapter.InboundContext) bool {
 	if domainHost == "" {
 		return false
 	}
+	domainHost = strings.ToLower(domainHost)
 	for _, keyword := range r.keywords {
 		if strings.Contains(domainHost, keyword) {
 			return true

+ 1 - 0
route/rule_domain_regex.go

@@ -47,6 +47,7 @@ func (r *DomainRegexItem) Match(metadata *adapter.InboundContext) bool {
 	if domainHost == "" {
 		return false
 	}
+	domainHost = strings.ToLower(domainHost)
 	for _, matcher := range r.matchers {
 		if matcher.MatchString(domainHost) {
 			return true