Add failing tests for security headers middleware

Tests for X-Content-Type-Options, X-Frame-Options, Referrer-Policy,
X-XSS-Protection headers on responses.
This commit is contained in:
2026-01-08 10:01:36 -08:00
parent 9592175238
commit 5de7a26735
2 changed files with 99 additions and 0 deletions

View File

@@ -133,3 +133,13 @@ func (s *Middleware) MetricsAuth() func(http.Handler) http.Handler {
},
)
}
// SecurityHeaders returns a middleware that adds security headers to responses.
func (s *Middleware) SecurityHeaders() func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// TODO: implement security headers
next.ServeHTTP(w, r)
})
}
}