Commit 9e9d9b89 authored by Daniel Smith's avatar Daniel Smith

Merge pull request #607 from smarterclayton/return_correct_content_type

Write the json content type for API responses
parents 8881adc9 30e881c3
...@@ -345,6 +345,7 @@ func (server *APIServer) notFound(w http.ResponseWriter, req *http.Request) { ...@@ -345,6 +345,7 @@ func (server *APIServer) notFound(w http.ResponseWriter, req *http.Request) {
} }
func (server *APIServer) write(statusCode int, object interface{}, w http.ResponseWriter) { func (server *APIServer) write(statusCode int, object interface{}, w http.ResponseWriter) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode) w.WriteHeader(statusCode)
output, err := api.Encode(object) output, err := api.Encode(object)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment