summaryrefslogtreecommitdiffstats
path: root/api/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/context.go')
-rw-r--r--api/context.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/api/context.go b/api/context.go
index 8e5becda7..d97295e5e 100644
--- a/api/context.go
+++ b/api/context.go
@@ -106,6 +106,9 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if !h.isApi {
w.Header().Set("X-Frame-Options", "DENY")
w.Header().Set("Content-Security-Policy", "frame-ancestors none")
+ } else {
+ // All api response bodies will be JSON formatted
+ w.Header().Set("Content-Type", "application/json")
}
sessionId := ""