asis & readme

This commit is contained in:
2023-09-28 15:42:22 +08:00
parent 043fb3db85
commit 8342e47e4b
4 changed files with 21 additions and 90 deletions

View File

@@ -21,7 +21,12 @@ func handleAuth(c *gin.Context) error {
authorization = strings.Trim(authorization[len("Bearer"):], " ")
log.Println("Received authorization", authorization)
if authConfig.Value != "asis" && authorization != authConfig.Value {
if authConfig.Value == "asis" {
log.Println("Authorization is asis, skipping")
return nil
}
if authorization != authConfig.Value {
err = errors.New("wrong authorization header")
c.AbortWithError(403, err)
return err