From 707fe8b2071d9a0c65a9ba8eddb1edb250180871 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Fri, 23 Jan 2026 09:28:54 +0800 Subject: [PATCH] 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. --- rules/common/domain.go | 4 +--- rules/common/domain_keyword.go | 4 +--- rules/common/domain_suffix.go | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/rules/common/domain.go b/rules/common/domain.go index c5bf2b88..4ab1f687 100644 --- a/rules/common/domain.go +++ b/rules/common/domain.go @@ -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, } } diff --git a/rules/common/domain_keyword.go b/rules/common/domain_keyword.go index 435c6449..5c7e9d3a 100644 --- a/rules/common/domain_keyword.go +++ b/rules/common/domain_keyword.go @@ -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, } } diff --git a/rules/common/domain_suffix.go b/rules/common/domain_suffix.go index 12c29550..bf66b90b 100644 --- a/rules/common/domain_suffix.go +++ b/rules/common/domain_suffix.go @@ -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, } }