mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 16:21:11 +08:00
fix
This commit is contained in:
parent
ee215eff36
commit
1d7780a890
1 changed files with 9 additions and 0 deletions
|
|
@ -38,6 +38,14 @@ func IsBlacklisted(username, repo string, blacklist map[string][]string, enabled
|
||||||
if !enabled {
|
if !enabled {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查 blacklist 是否为 nil
|
||||||
|
if blacklist == nil {
|
||||||
|
// 可以选择记录日志或返回 false
|
||||||
|
logw("Warning: Blacklist map is nil")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if repos, ok := blacklist[username]; ok {
|
if repos, ok := blacklist[username]; ok {
|
||||||
for _, blacklistedRepo := range repos {
|
for _, blacklistedRepo := range repos {
|
||||||
if blacklistedRepo == repo {
|
if blacklistedRepo == repo {
|
||||||
|
|
@ -45,5 +53,6 @@ func IsBlacklisted(username, repo string, blacklist map[string][]string, enabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue