refactor: refactoring of auth middlewares

This commit is contained in:
Jonas Kaninda
2024-11-25 07:38:49 +01:00
parent f4e5bb3be2
commit dbd0974388
5 changed files with 25 additions and 18 deletions

View File

@@ -53,9 +53,9 @@ func isPathBlocked(requestPath, blockedPath string) bool {
}
return false
}
func isProtectedPath(urlPath string, paths []string) bool {
func isProtectedPath(urlPath, prefix string, paths []string) bool {
for _, path := range paths {
return isPathBlocked(urlPath, util.ParseURLPath(path))
return isPathBlocked(urlPath, util.ParseURLPath(prefix+path))
}
return false
}