1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

Avoid potential click jacking (#190)

This commit is contained in:
Stuart Skelton
2020-11-19 16:16:01 +00:00
committed by GitHub
parent 7f430f2bde
commit 3c5960aba0

View File

@@ -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).