Commit 30e881c3 authored by Clayton Coleman's avatar Clayton Coleman

Write JSON content type for API responses

parent 5ae20f9e
......@@ -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) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode)
output, err := api.Encode(object)
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