mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
fix
This commit is contained in:
parent
862b92a1c5
commit
eec50879e9
2 changed files with 7 additions and 7 deletions
|
|
@ -48,14 +48,14 @@ func NoRouteHandler(cfg *config.Config, blacklist *config.Blacklist) gin.Handler
|
|||
repo := pathParts[2]
|
||||
logw("Blacklist Check > Username: %s, Repo: %s", username, repo)
|
||||
|
||||
if blacklist.Blacklist == nil {
|
||||
if blacklist.Blist == nil {
|
||||
logw("Warning: Blacklist map is nil")
|
||||
// 根据需要初始化或处理
|
||||
blacklist.Blacklist = make(map[string][]string)
|
||||
blacklist.Blist = make(map[string][]string)
|
||||
}
|
||||
|
||||
// 检查仓库是否在黑名单中
|
||||
if auth.IsBlacklisted(username, repo, blacklist.Blacklist, cfg.Blacklist.Enabled) {
|
||||
if auth.IsBlacklisted(username, repo, blacklist.Blist, cfg.Blacklist.Enabled) {
|
||||
c.String(http.StatusForbidden, "Access denied: repository is blacklisted.")
|
||||
logw("Blacklisted repository: %s/%s", username, repo)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue