Improve: auto change payload to lowercase

This commit is contained in:
Dreamacro 2018-11-21 13:59:39 +08:00
parent 01a477bd3d
commit c7a349e1fe
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,8 @@
package rules package rules
import ( import (
"strings"
C "github.com/Dreamacro/clash/constant" C "github.com/Dreamacro/clash/constant"
) )
@ -30,7 +32,7 @@ func (d *Domain) Payload() string {
func NewDomain(domain string, adapter string) *Domain { func NewDomain(domain string, adapter string) *Domain {
return &Domain{ return &Domain{
domain: domain, domain: strings.ToLower(domain),
adapter: adapter, adapter: adapter,
} }
} }

View File

@ -33,7 +33,7 @@ func (dk *DomainKeyword) Payload() string {
func NewDomainKeyword(keyword string, adapter string) *DomainKeyword { func NewDomainKeyword(keyword string, adapter string) *DomainKeyword {
return &DomainKeyword{ return &DomainKeyword{
keyword: keyword, keyword: strings.ToLower(keyword),
adapter: adapter, adapter: adapter,
} }
} }

View File

@ -33,7 +33,7 @@ func (ds *DomainSuffix) Payload() string {
func NewDomainSuffix(suffix string, adapter string) *DomainSuffix { func NewDomainSuffix(suffix string, adapter string) *DomainSuffix {
return &DomainSuffix{ return &DomainSuffix{
suffix: suffix, suffix: strings.ToLower(suffix),
adapter: adapter, adapter: adapter,
} }
} }