mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-30 05:25:35 +00:00
ipn/localapi: don't indent status response
Doing indented JSON marshaling results in encoding/json allocating an internal buffer, so even when encoding directly to a writer, it still generates a lot of garbage. Updates tailscale/corp#18514 Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
parent
512fc0b502
commit
c1029de875
@ -1202,9 +1202,7 @@ func (h *Handler) serveStatus(w http.ResponseWriter, r *http.Request) {
|
|||||||
} else {
|
} else {
|
||||||
st = h.b.StatusWithoutPeers()
|
st = h.b.StatusWithoutPeers()
|
||||||
}
|
}
|
||||||
e := json.NewEncoder(w)
|
json.NewEncoder(w).Encode(st)
|
||||||
e.SetIndent("", "\t")
|
|
||||||
e.Encode(st)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) serveDebugPeerEndpointChanges(w http.ResponseWriter, r *http.Request) {
|
func (h *Handler) serveDebugPeerEndpointChanges(w http.ResponseWriter, r *http.Request) {
|
||||||
|
Loading…
Reference in New Issue
Block a user