mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-05 16:56:54 +08:00
Chore(netstats): just render.JSON
This commit is contained in:
@@ -38,11 +38,7 @@ func getNetStats(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if !websocket.IsWebSocketUpgrade(r) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
render.Status(r, http.StatusOK)
|
||||
// write and flush.
|
||||
w.Write(snapshot())
|
||||
w.(http.Flusher).Flush()
|
||||
render.JSON(w, r, snapshot())
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user