mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 22:06:20 +00:00
Merge pull request #46 from jpfuentes2/jf_fix_json_header
agent: Ensure we write json header before writing bytes
This commit is contained in:
commit
a7a51baf5c
@ -124,8 +124,8 @@ func (s *HTTPServer) wrap(handler func(resp http.ResponseWriter, req *http.Reque
|
|||||||
if err = enc.Encode(obj); err != nil {
|
if err = enc.Encode(obj); err != nil {
|
||||||
goto HAS_ERR
|
goto HAS_ERR
|
||||||
}
|
}
|
||||||
resp.Write(buf.Bytes())
|
|
||||||
resp.Header().Set("Content-Type", "application/json")
|
resp.Header().Set("Content-Type", "application/json")
|
||||||
|
resp.Write(buf.Bytes())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return f
|
return f
|
||||||
|
Loading…
x
Reference in New Issue
Block a user