mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
25w01c
This commit is contained in:
parent
e4252d0596
commit
a281d4c779
3 changed files with 12 additions and 1 deletions
|
|
@ -286,6 +286,9 @@ func authPassThrough(c *gin.Context, cfg *config.Config, req *req.Request) {
|
|||
req.SetHeader("Authorization", "token "+token)
|
||||
} else {
|
||||
logWarning("%s %s %s %s %s Auth-Error: Conflict Auth Method", c.ClientIP(), c.Request.Method, c.Request.URL.String(), c.Request.Header.Get("User-Agent"), c.Request.Proto)
|
||||
// 500 Internal Server Error
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Conflict Auth Method"})
|
||||
return
|
||||
}
|
||||
case "header":
|
||||
if cfg.Auth.Enabled {
|
||||
|
|
@ -293,6 +296,9 @@ func authPassThrough(c *gin.Context, cfg *config.Config, req *req.Request) {
|
|||
}
|
||||
default:
|
||||
logWarning("%s %s %s %s %s Invalid Auth Method / Auth Method is not be set", c.ClientIP(), c.Request.Method, c.Request.URL.String(), c.Request.Header.Get("User-Agent"), c.Request.Proto)
|
||||
// 500 Internal Server Error
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Invalid Auth Method / Auth Method is not be set"})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue