Explorar o código

set x-frame-options to deny

Alexander Belanger %!s(int64=4) %!d(string=hai) anos
pai
achega
23a65674b5
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      api/server/router/router.go

+ 2 - 0
api/server/router/router.go

@@ -108,6 +108,8 @@ func NewAPIRouter(config *config.Config) *chi.Mux {
 	fs := http.FileServer(http.Dir(staticFilePath))
 
 	r.Get("/*", func(w http.ResponseWriter, r *http.Request) {
+		w.Header().Set("X-Frame-Options", "DENY")
+
 		if _, err := os.Stat(staticFilePath + r.RequestURI); os.IsNotExist(err) {
 			w.Header().Set("Cache-Control", "no-cache")