API sets json content-type

This commit is contained in:
Jimmy Zelinskie 2014-07-16 06:00:20 -04:00
parent c762946ed7
commit 251b5c5f18

View file

@ -43,6 +43,7 @@ func (t *Tracker) getTorrent(w http.ResponseWriter, r *http.Request, p httproute
return http.StatusInternalServerError, err
}
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
e := json.NewEncoder(w)
err = e.Encode(torrent)
if err != nil {
@ -111,6 +112,7 @@ func (t *Tracker) getUser(w http.ResponseWriter, r *http.Request, p httprouter.P
return http.StatusInternalServerError, err
}
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
e := json.NewEncoder(w)
err = e.Encode(user)
if err != nil {