Skip to content

Commit

Permalink
Avoid potential click jacking (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartskelton committed Nov 19, 2020
1 parent 7f430f2 commit 3c5960a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/server/web/handlers.go
Expand Up @@ -94,6 +94,8 @@ func spaTemplateHandler(tmpl *template.Template, basePath string,
BasePath: basePath,
}
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
// ensure we do now allow click jacking
w.Header().Set("X-Frame-Options", "SameOrigin")
err := tmpl.Execute(w, tmplData)
if err != nil {
log.Error().Str("module", "web").Str("remote", req.RemoteAddr).Str("proto", req.Proto).
Expand Down

0 comments on commit 3c5960a

Please sign in to comment.