diff --git a/command/agent/http.go b/command/agent/http.go index 9241ca493c..a5fde2dbd9 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -124,8 +124,8 @@ func (s *HTTPServer) wrap(handler func(resp http.ResponseWriter, req *http.Reque if err = enc.Encode(obj); err != nil { goto HAS_ERR } - resp.Write(buf.Bytes()) resp.Header().Set("Content-Type", "application/json") + resp.Write(buf.Bytes()) } } return f