mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
api/v1: fix Content-Type in response
This commit is contained in:
parent
293f3808fb
commit
b36fa7ad61
|
@ -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…
Reference in a new issue