From b36fa7ad6127c6957181f3cb8fa7fad7237358f3 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Wed, 1 Jul 2015 22:47:25 +0200 Subject: [PATCH] api/v1: fix Content-Type in response --- web/api/v1/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/api/v1/api.go b/web/api/v1/api.go index 79dec86a6..b5a30da04 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -236,8 +236,8 @@ func (api *API) dropSeries(r *http.Request) (interface{}, *apiError) { } func respond(w http.ResponseWriter, data interface{}) { - w.WriteHeader(200) w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) b, err := json.Marshal(&response{ Status: statusSuccess, @@ -250,8 +250,8 @@ func respond(w http.ResponseWriter, data interface{}) { } func respondError(w http.ResponseWriter, apiErr *apiError, data interface{}) { - w.WriteHeader(422) w.Header().Set("Content-Type", "application/json") + w.WriteHeader(422) b, err := json.Marshal(&response{ Status: statusError,