Updating content security policy. (#9906)
Этот коммит содержится в:
коммит произвёл
Daniel Schalla
родитель
bf19debdfd
Коммит
2770d4db64
@@ -84,7 +84,8 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
if h.IsStatic {
|
if h.IsStatic {
|
||||||
// Instruct the browser not to display us in an iframe unless is the same origin for anti-clickjacking
|
// Instruct the browser not to display us in an iframe unless is the same origin for anti-clickjacking
|
||||||
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
|
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
|
||||||
w.Header().Set("Content-Security-Policy", "frame-ancestors 'self'")
|
// Set content security policy. This is also specified in the root.html of the webapp in a meta tag.
|
||||||
|
w.Header().Set("Content-Security-Policy", "frame-ancestors 'self'; script-src 'self' cdn.segment.com/analytics.js/")
|
||||||
} else {
|
} else {
|
||||||
// All api response bodies will be JSON formatted by default
|
// All api response bodies will be JSON formatted by default
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user