mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-31 16:23:44 +00:00
use new encoder, not marshalindent
This commit is contained in:
parent
3a35ac716d
commit
f7ec770f03
@ -117,8 +117,13 @@ func (m *monitor) handleNetmap(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "", 500)
|
||||
return
|
||||
}
|
||||
j, _ := json.MarshalIndent(n.NetMap, "", "\t")
|
||||
w.Write([]byte(j))
|
||||
encoder := json.NewEncoder(w)
|
||||
encoder.SetIndent("", "\t")
|
||||
if err := encoder.Encode(n); err != nil {
|
||||
log.Printf("monitor: error encoding netmap: %v", err)
|
||||
http.Error(w, "", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user