mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
Avoid potential click jacking (#190)
This commit is contained in:
@@ -94,6 +94,8 @@ func spaTemplateHandler(tmpl *template.Template, basePath string,
|
|||||||
BasePath: basePath,
|
BasePath: basePath,
|
||||||
}
|
}
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
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)
|
err := tmpl.Execute(w, tmplData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Str("module", "web").Str("remote", req.RemoteAddr).Str("proto", req.Proto).
|
log.Error().Str("module", "web").Str("remote", req.RemoteAddr).Str("proto", req.Proto).
|
||||||
|
|||||||
Reference in New Issue
Block a user