set content header in marshalJSON

This commit is contained in:
Livio Amstutz 2019-12-02 16:14:52 +01:00
parent 1cee49002d
commit 2ff421188e

View file

@ -13,6 +13,7 @@ func MarshalJSON(w http.ResponseWriter, i interface{}) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.Header().Set("content-type", "application/json")
_, err = w.Write(b)
if err != nil {
logrus.Error("error writing response")