From 67cc81631a1b231bed5682ffb8b56c465093aebd Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Mon, 27 Jun 2016 22:22:52 +0500 Subject: [PATCH] Web server test --- noolite-cli.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/noolite-cli.go b/noolite-cli.go index 640ac82..2440838 100644 --- a/noolite-cli.go +++ b/noolite-cli.go @@ -68,8 +68,12 @@ func main() { if *http_port != -1 { http.HandleFunc("/switch", func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "%q", r.URL.RawQuery) - n.Switch(7) + fmt.Fprintf(w, "%q", r.URL.Query()) + err := n.Switch(7) + + if err != nil { + fmt.Fprintf(w, "%q", err) + } }) http.ListenAndServe(":8080", nil)