From 0920ee12f8ad4ad798ede00f6ee3ff5f269c4e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 30 Aug 2022 10:43:42 +0800 Subject: [PATCH] Minor fixes --- route/router.go | 4 ++-- route/{rule_process.go => rule_process_name.go} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename route/{rule_process.go => rule_process_name.go} (93%) diff --git a/route/router.go b/route/router.go index fe81dc24..a95ed1f1 100644 --- a/route/router.go +++ b/route/router.go @@ -789,11 +789,11 @@ func isGeositeDNSRule(rule option.DefaultDNSRule) bool { } func isProcessRule(rule option.DefaultRule) bool { - return len(rule.ProcessName) > 0 || len(rule.PackageName) > 0 || len(rule.User) > 0 || len(rule.UserID) > 0 || len(rule.ProcessPath) > 0 + return len(rule.ProcessName) > 0 || len(rule.ProcessPath) > 0 || len(rule.PackageName) > 0 || len(rule.User) > 0 || len(rule.UserID) > 0 } func isProcessDNSRule(rule option.DefaultDNSRule) bool { - return len(rule.ProcessName) > 0 || len(rule.PackageName) > 0 || len(rule.User) > 0 || len(rule.UserID) > 0 || len(rule.ProcessPath) > 0 + return len(rule.ProcessName) > 0 || len(rule.ProcessPath) > 0 || len(rule.PackageName) > 0 || len(rule.User) > 0 || len(rule.UserID) > 0 } func notPrivateNode(code string) bool { diff --git a/route/rule_process.go b/route/rule_process_name.go similarity index 93% rename from route/rule_process.go rename to route/rule_process_name.go index 223a16ef..b0a151a1 100644 --- a/route/rule_process.go +++ b/route/rule_process_name.go @@ -37,7 +37,7 @@ func (r *ProcessItem) Match(metadata *adapter.InboundContext) bool { if metadata.ProcessInfo == nil || metadata.ProcessInfo.ProcessPath == "" { return false } - return r.processMap[strings.ToLower(filepath.Base(metadata.ProcessInfo.ProcessPath))] + return r.processMap[filepath.Base(metadata.ProcessInfo.ProcessPath)] } func (r *ProcessItem) String() string {