make weave status show whether encryption is on/off

Closes #323.
This commit is contained in:
Matthias Radestock committed 2015-01-09 12:56:26 +00:00
1 parent f70dfe9de8
commit 11b87f879a
2 files changed
+6

No files matched your search

+5
View File
@@ -135,8 +135,13 @@ func main() {
}
func handleHttp(router *weave.Router) {
encryption := "off"
if router.Password != nil && len(*router.Password) > 0 {
encryption = "on"
}
http.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, fmt.Sprintln("weave router", version))
io.WriteString(w, fmt.Sprintln("Encryption", encryption))
io.WriteString(w, router.Status())
})
http.HandleFunc("/connect", func(w http.ResponseWriter, r *http.Request) {