mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Limited the added headers to only non-api calls
This commit is contained in:
@@ -100,8 +100,12 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
w.Header().Set(model.HEADER_REQUEST_ID, c.RequestId)
|
||||
w.Header().Set(model.HEADER_VERSION_ID, utils.Cfg.ServiceSettings.Version)
|
||||
w.Header().Set("X-FRAME-OPTIONS", "DENY")
|
||||
w.Header().Set("Content-Security-Policy", "frame-ancestors none")
|
||||
|
||||
// Instruct the browser not to display us in an iframe for anti-clickjacking
|
||||
if !h.isApi {
|
||||
w.Header().Set("X-Frame-Options", "DENY")
|
||||
w.Header().Set("Content-Security-Policy", "frame-ancestors none")
|
||||
}
|
||||
|
||||
sessionId := ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user