github.com/chenbh/concourse/v6@v6.4.2/atc/wrappa/security_handler.go (about) 1 package wrappa 2 3 import "net/http" 4 5 type SecurityHandler struct { 6 XFrameOptions string 7 Handler http.Handler 8 } 9 10 func (handler SecurityHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { 11 if handler.XFrameOptions != "" { 12 w.Header().Set("X-Frame-Options", handler.XFrameOptions) 13 } 14 w.Header().Set("X-XSS-Protection", "1; mode=block") 15 w.Header().Set("X-Content-Type-Options", "nosniff") 16 w.Header().Set("X-Download-Options", "noopen") 17 handler.Handler.ServeHTTP(w, r) 18 }