Browse Source

Send correct content-type.

master
Robert Jacob 3 years ago
parent
commit
2007d55660
  1. 1
      web/web.go

1
web/web.go

@ -21,6 +21,7 @@ func handleReadStatus(statusFunc func() spaceapi.SpaceStatus) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
status := statusFunc()
w.Header().Set("Content-Type", "application/json; charset=utf-8")
if err := json.NewEncoder(w).Encode(status); err != nil {
http.Error(w, fmt.Sprintf("Error encoding JSON: %s", err), http.StatusInternalServerError)
}

Loading…
Cancel
Save