1
0
mirror of https://github.com/MetaCubeX/mihomo.git synced 2025-07-18 17:08:06 +08:00

chore: sniffer replace domain only if domain is valid (#2122)

This commit is contained in:
ayanamist
2025-06-24 21:44:26 +08:00
committed by GitHub
parent 5c6aa433ca
commit 166392fe17

View File

@ -6,6 +6,8 @@ import (
"net/netip"
"time"
"github.com/metacubex/sing/common/metadata"
"github.com/metacubex/mihomo/common/lru"
N "github.com/metacubex/mihomo/common/net"
C "github.com/metacubex/mihomo/constant"
@ -164,6 +166,9 @@ func replaceDomain(metadata *C.Metadata, host string, overrideDest bool) {
}
func (sd *Dispatcher) domainCanReplace(host string) bool {
if host == "." || !metadata.IsDomainName(host) {
return false
}
for _, matcher := range sd.skipDomain {
if matcher.MatchDomain(host) {
return false