Merge branch 'pr1077'

This commit is contained in:
Michael Bridgen committed 2015-07-06 16:27:45 +01:00
commit 59550e0fcb
1 file changed
+6 -5
+6 -5
View File
@@ -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)