Browse Source

Merge pull request #1491 from porter-dev/belanger/fix-x-frame-options

Set `X-Frame-Options` to `DENY`
abelanger5 4 years ago
parent
commit
14dbd053d4
1 changed files with 2 additions and 0 deletions
  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")