1
0
Fork 0

Set Content-type "application/json" on responses

master
Philip O'Toole 8 years ago
parent d7ca1352eb
commit 5b4b1e3567

@ -1,4 +1,5 @@
## 3.6.0 (unreleased)
- [PR #195](https://github.com/rqlite/rqlite/pull/195): Set Content-type "application/json" on all HTTP responses.
- [PR #193](https://github.com/rqlite/rqlite/pull/193): Allow joining a cluster through any node, not just the leader.
- [PR #187](https://github.com/rqlite/rqlite/pull/187): Support memory profiling.
- Go cyclo complexity changes.

@ -200,6 +200,7 @@ func (s *Service) Close() {
// ServeHTTP allows Service to serve HTTP requests.
func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
s.addBuildVersion(w)
if s.credentialStore != nil {
@ -627,7 +628,6 @@ func queriesValid(queries []string) bool {
// serveExpvar serves registered expvar information over HTTP.
func serveExpvar(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
fmt.Fprintf(w, "{\n")
first := true
expvar.Do(func(kv expvar.KeyValue) {

Loading…
Cancel
Save