From 27e59c32f933e6b52a01a73b774e6b0ade0d1d4d Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 11 Sep 2015 12:11:10 -0400 Subject: Set default Content-Type to application/json for all API requests --- api/context.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/context.go b/api/context.go index aaf304e2c..ac5dbc7ec 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 := "" -- cgit v1.2.3-1-g7c22