The proper Content-Type for JSON is application/json.
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 13 Oct 2012 21:40:53 +0000 (17:40 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 13 Oct 2012 21:40:53 +0000 (17:40 -0400)
server/server.go

index 66c3c3c6c9ff6ef57d0369ddae93e97e8511fcea..a4214efb8cc565f0f4d73747c2320fa0688a8700 100644 (file)
@@ -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")