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
1d7780a890
commit
862b92a1c5
1 changed files with 6 additions and 0 deletions
|
|
@ -48,6 +48,12 @@ 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 {
|
||||
logw("Warning: Blacklist map is nil")
|
||||
// 根据需要初始化或处理
|
||||
blacklist.Blacklist = make(map[string][]string)
|
||||
}
|
||||
|
||||
// 检查仓库是否在黑名单中
|
||||
if auth.IsBlacklisted(username, repo, blacklist.Blacklist, cfg.Blacklist.Enabled) {
|
||||
c.String(http.StatusForbidden, "Access denied: repository is blacklisted.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue