Fix: netstats JSON response

This commit is contained in:
xjasonlyu
2023-04-03 19:59:37 +08:00
parent 2d0bd1d219
commit 2dbd2caaa9

View File

@@ -38,7 +38,10 @@ func getNetStats(w http.ResponseWriter, r *http.Request) {
}
if !websocket.IsWebSocketUpgrade(r) {
render.JSON(w, r, snapshot())
w.Header().Set("Content-Type", "application/json")
render.Status(r, http.StatusOK)
w.Write(snapshot())
w.(http.Flusher).Flush()
return
}