Browse Source

Merge pull request #868 from prometheus/fabxc/ctype

api/v1: fix Content-Type in response
pull/870/head
Fabian Reinartz 10 years ago
parent
commit
6b3d79cfce
  1. 4
      web/api/v1/api.go

4
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,

Loading…
Cancel
Save