From 924f7e9ab58b9572e2c01e00defdcc33fd3ff999 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 13 Oct 2012 17:40:53 -0400 Subject: [PATCH] The proper Content-Type for JSON is application/json. --- server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/server.go b/server/server.go index 66c3c3c..a4214ef 100644 --- a/server/server.go +++ b/server/server.go @@ -135,7 +135,7 @@ func errorResponse(response http.ResponseWriter, message string) { } json_data, err := json.Marshal(data) - response.Header().Set("Content-Type", "text/json") + response.Header().Set("Content-Type", "application/json") if err != nil { io.WriteString(response, "{\"error\":\"-9\",\"message\":\"Internal encoding error\"}") } else { @@ -144,7 +144,7 @@ func errorResponse(response http.ResponseWriter, message string) { } func okResponse(response http.ResponseWriter, data interface{}) { - response.Header().Set("Content-Type", "text/json") + response.Header().Set("Content-Type", "application/json") json_data, err := json.Marshal(data) if err != nil { errorResponse(response, "Internal encoding error") -- 2.22.5