Browse Source

Send correct content-type.

master
Robert Jacob 11 months ago
parent
commit
2007d55660
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      web/web.go

+ 1
- 0
web/web.go View File

@@ -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