ipn/localapi: set security headers

Change-Id: I028b6ab91229e2f824e5a69856ca9e1844f7486e
Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
pull/6370/head
Andrew Dunham 2 years ago
parent 1b8c13e18a
commit cec48743fb

@ -143,6 +143,9 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return return
} }
w.Header().Set("Tailscale-Version", version.Long) w.Header().Set("Tailscale-Version", version.Long)
w.Header().Set("Content-Security-Policy", `default-src 'none'; frame-ancestors 'none'; script-src 'none'; script-src-elem 'none'; script-src-attr 'none'`)
w.Header().Set("X-Frame-Options", "DENY")
w.Header().Set("X-Content-Type-Options", "nosniff")
if h.RequiredPassword != "" { if h.RequiredPassword != "" {
_, pass, ok := r.BasicAuth() _, pass, ok := r.BasicAuth()
if !ok { if !ok {

Loading…
Cancel
Save