mirror of https://github.com/hashicorp/consul
modified so ?pretty=anything will work
parent
e3c4052982
commit
a5775aae24
|
@ -138,13 +138,13 @@ func (s *HTTPServer) wrap(handler func(resp http.ResponseWriter, req *http.Reque
|
|||
}
|
||||
|
||||
prettyPrint := false
|
||||
if req.URL.Query().Get("pretty") == "true" {
|
||||
if req.URL.Query().Get("pretty") != "" {
|
||||
prettyPrint = true
|
||||
}
|
||||
// Write out the JSON object
|
||||
if obj != nil {
|
||||
var buf []byte
|
||||
if prettyPrint == true {
|
||||
if prettyPrint {
|
||||
buf, err = json.MarshalIndent(obj, "", " ")
|
||||
} else {
|
||||
buf, err = json.Marshal(obj)
|
||||
|
|
Loading…
Reference in New Issue