diff --git a/router/json.go b/router/json.go index 68abacc7..e3091b24 100644 --- a/router/json.go +++ b/router/json.go @@ -6,13 +6,15 @@ import ( "time" ) -func (router *Router) MarshalJSON() ([]byte, error) { +func (router *Router) GenerateStatusJSON(version, encryption string) ([]byte, error) { return json.Marshal(struct { + Version string + Encryption string Name, Interface string Macs *MacCache Peers *Peers Routes *Routes - }{router.Ourself.Name.String(), fmt.Sprintf("%v", router.Iface), router.Macs, router.Peers, router.Routes}) + }{version, encryption, router.Ourself.Name.String(), fmt.Sprintf("%v", router.Iface), router.Macs, router.Peers, router.Routes}) // leaving out ConectionMaker due to async complexities } diff --git a/weaver/main.go b/weaver/main.go index 5a6b3075..7d3aae93 100644 --- a/weaver/main.go +++ b/weaver/main.go @@ -146,7 +146,7 @@ func handleHttp(router *weave.Router) { io.WriteString(w, router.Status()) }) http.HandleFunc("/status-json", func(w http.ResponseWriter, r *http.Request) { - json, _ := router.MarshalJSON() + json, _ := router.GenerateStatusJSON(version, encryption) w.Write(json) }) http.HandleFunc("/connect", func(w http.ResponseWriter, r *http.Request) {