diff --git a/prog/weaver/main.go b/prog/weaver/main.go index be5e50ae..4f4b68de 100644 --- a/prog/weaver/main.go +++ b/prog/weaver/main.go @@ -259,6 +259,12 @@ func handleHTTP(router *weave.Router, httpAddr string, allocator *ipam.Allocator allocator.HandleHTTP(muxRouter, defaultSubnet, docker) } + muxRouter.Methods("GET").Path("/status").Headers("Accept", "application/json").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + json, _ := router.StatusJSON(version) + w.Header().Set("Content-Type", "application/json") + w.Write(json) + }) + muxRouter.Methods("GET").Path("/status").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "weave router", version) fmt.Fprintln(w, router.Status()) @@ -268,11 +274,6 @@ func handleHTTP(router *weave.Router, httpAddr string, allocator *ipam.Allocator } }) - muxRouter.Methods("GET").Path("/status-json").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - json, _ := router.StatusJSON(version) - w.Write(json) - }) - muxRouter.Methods("POST").Path("/connect").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if err := r.ParseForm(); err != nil { http.Error(w, fmt.Sprint("unable to parse form: ", err), http.StatusBadRequest)