mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 08:31:30 +00:00
ignore domain case in route rules
This commit is contained in:
parent
fe492904e9
commit
5d41e328d4
|
@ -53,7 +53,7 @@ func (r *DomainItem) Match(metadata *adapter.InboundContext) bool {
|
||||||
if domainHost == "" {
|
if domainHost == "" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return r.matcher.Match(domainHost)
|
return r.matcher.Match(strings.ToLower(domainHost))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *DomainItem) String() string {
|
func (r *DomainItem) String() string {
|
||||||
|
|
|
@ -26,6 +26,7 @@ func (r *DomainKeywordItem) Match(metadata *adapter.InboundContext) bool {
|
||||||
if domainHost == "" {
|
if domainHost == "" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
domainHost = strings.ToLower(domainHost)
|
||||||
for _, keyword := range r.keywords {
|
for _, keyword := range r.keywords {
|
||||||
if strings.Contains(domainHost, keyword) {
|
if strings.Contains(domainHost, keyword) {
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -47,6 +47,7 @@ func (r *DomainRegexItem) Match(metadata *adapter.InboundContext) bool {
|
||||||
if domainHost == "" {
|
if domainHost == "" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
domainHost = strings.ToLower(domainHost)
|
||||||
for _, matcher := range r.matchers {
|
for _, matcher := range r.matchers {
|
||||||
if matcher.MatchString(domainHost) {
|
if matcher.MatchString(domainHost) {
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue