feat: add block common exploits middleware

This commit is contained in:
2024-11-06 09:17:21 +01:00
parent a23111f1ad
commit 69e29dee2a
5 changed files with 120 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ func (jwtAuth JwtAuth) AuthMiddleware(next http.Handler) http.Handler {
if r.Header.Get(header) == "" {
logger.Error("Proxy error, missing %s header", header)
w.Header().Set("Content-Type", "application/json")
//Update Origin Cors Headers
//check allowed origin
if allowedOrigin(jwtAuth.Origins, r.Header.Get("Origin")) {
w.Header().Set("Access-Control-Allow-Origin", r.Header.Get("Origin"))
}