Skip to content

Commit

Permalink
Merge pull request #67 from sev-2/hotfix/auth-proxy
Browse files Browse the repository at this point in the history
Fix Auth Proxy
  • Loading branch information
toopay authored Sep 11, 2024
2 parents 9d18cdc + d5d5157 commit 12560fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,9 @@ func AuthProxy(

// validate sub path
forwardedPath := paths[1]
subPath := strings.Split(forwardedPath, "/")
if _, exist := allowedAuthPathMap[subPath[1]]; !exist {
parsedURL, _ := url.Parse(forwardedPath)
segments := strings.Split(strings.Trim(parsedURL.Path, "/"), "/")
if _, exist := allowedAuthPathMap[segments[0]]; !exist {
ctx.Response.SetStatusCode(fasthttp.StatusNotFound)
errResponse := "{ \"messages\": \"resource not found\"}"
ctx.Response.SetBodyString(errResponse)
Expand Down

0 comments on commit 12560fc

Please sign in to comment.