chore: remove auto IDNA conversion in domain rules

The original upstream does not support it, and there are many places in the current code that do not support it either. Removing it will help maintain consistency in behavior across different parts.
This commit is contained in:
wwqgtxx
2026-01-23 09:28:54 +08:00
parent 1e1434d1de
commit 707fe8b207
3 changed files with 3 additions and 9 deletions

View File

@@ -4,7 +4,6 @@ import (
"strings"
C "github.com/metacubex/mihomo/constant"
"golang.org/x/net/idna"
)
type Domain struct {
@@ -30,10 +29,9 @@ func (d *Domain) Payload() string {
}
func NewDomain(domain string, adapter string) *Domain {
punycode, _ := idna.ToASCII(strings.ToLower(domain))
return &Domain{
Base: Base{},
domain: punycode,
domain: strings.ToLower(domain),
adapter: adapter,
}
}

View File

@@ -4,7 +4,6 @@ import (
"strings"
C "github.com/metacubex/mihomo/constant"
"golang.org/x/net/idna"
)
type DomainKeyword struct {
@@ -31,10 +30,9 @@ func (dk *DomainKeyword) Payload() string {
}
func NewDomainKeyword(keyword string, adapter string) *DomainKeyword {
punycode, _ := idna.ToASCII(strings.ToLower(keyword))
return &DomainKeyword{
Base: Base{},
keyword: punycode,
keyword: strings.ToLower(keyword),
adapter: adapter,
}
}

View File

@@ -4,7 +4,6 @@ import (
"strings"
C "github.com/metacubex/mihomo/constant"
"golang.org/x/net/idna"
)
type DomainSuffix struct {
@@ -31,10 +30,9 @@ func (ds *DomainSuffix) Payload() string {
}
func NewDomainSuffix(suffix string, adapter string) *DomainSuffix {
punycode, _ := idna.ToASCII(strings.ToLower(suffix))
return &DomainSuffix{
Base: Base{},
suffix: punycode,
suffix: strings.ToLower(suffix),
adapter: adapter,
}
}