From 8bc9c2bd216a007fa32c21cbe228c9c24ef19490 Mon Sep 17 00:00:00 2001 From: NewName Date: Wed, 25 Dec 2024 06:54:46 +0800 Subject: [PATCH] Update main.go --- ghproxy/main.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ghproxy/main.go b/ghproxy/main.go index 69c1302..60e3f6b 100644 --- a/ghproxy/main.go +++ b/ghproxy/main.go @@ -205,17 +205,11 @@ func checkURL(u string) []string { return nil } -// 匹配关键字 +// 匹配用户名或者仓库名 func checkList(matches, list []string) bool { - if len(matches) == 0 { - return false - } - for _, item := range list { - for i := 1; i < len(matches); i++ { - if strings.HasPrefix(matches[i], item) { - return true - } + if strings.HasPrefix(matches[0], item) || strings.HasPrefix(matches[1], item) { + return true } } return false