1
0

In ListenersGet() text/plain was replaced by application/json.

This commit is contained in:
Alexander Andreev 2023-10-02 02:35:01 +04:00
parent d2851c6fb8
commit f0438ff822
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

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