sabisan/internal/app/middleware.go

12 lines
313 B
Go
Raw Permalink Normal View History

2026-05-16 23:03:50 +00:00
package app
import "net/http"
func securityHeaders(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("X-Content-Type-Options", "nosniff")
w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin")
next.ServeHTTP(w, r)
})
}