mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-01 06:18:58 -07:00
API sets json content-type
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user