Write JSON content type for API responses

This commit is contained in:
Clayton Coleman 2014-07-24 17:45:02 -04:00
parent 5ae20f9edb
commit 30e881c3f9

View File

@ -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 {