|
|
@@ -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)
|