mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-25 19:21:18 -08:00
use new encoder, not marshalindent
This commit is contained in:
1 parent
3a35ac716d
commit
f7ec770f03
1 file changed
+7
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user