In ListenersGet() text/plain was replaced by application/json.
This commit is contained in:
parent
d2851c6fb8
commit
f0438ff822
@ -23,8 +23,8 @@ func NewDJHandlers(l *radio.ListenerCounter, p *radio.Playlist, slLen int) *DJHa
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (dj *DJHandlers) ListenersGet(w http.ResponseWriter, _ *http.Request) {
|
func (dj *DJHandlers) ListenersGet(w http.ResponseWriter, _ *http.Request) {
|
||||||
w.Header().Add("Content-Type", "text/plain")
|
w.Header().Add("Content-Type", "application/json")
|
||||||
fmt.Fprint(w, dj.listeners.Current(), dj.listeners.Peak())
|
json.NewEncoder(w).Encode(dj.listeners)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dj *DJHandlers) ListenersInc(w http.ResponseWriter, _ *http.Request) {
|
func (dj *DJHandlers) ListenersInc(w http.ResponseWriter, _ *http.Request) {
|
||||||
|
Loading…
Reference in New Issue
Block a user