Skip to content

Commit 0c5b556

Browse files
authored
Update main.go
1 parent 19c93b6 commit 0c5b556

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

ghproxy/main.go

+3-9
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,11 @@ func checkURL(u string) []string {
205205
return nil
206206
}
207207

208-
// 匹配关键字
208+
// 匹配用户名或者仓库名
209209
func checkList(matches, list []string) bool {
210-
if len(matches) == 0 {
211-
return false
212-
}
213-
214210
for _, item := range list {
215-
for i := 1; i < len(matches); i++ {
216-
if strings.HasPrefix(matches[i], item) {
217-
return true
218-
}
211+
if strings.HasPrefix(matches[0], item) || strings.HasPrefix(matches[1], item) {
212+
return true
219213
}
220214
}
221215
return false

0 commit comments

Comments
 (0)