Better error-checking

This commit is contained in:
Bryan Boreham committed 2014-10-14 16:49:27 +01:00
1 parent 10772f8289
commit ff540265a9
1 file changed
+1
+1
View File
@@ -28,6 +28,7 @@ func ListenHttp(db Zone, port int) {
local_ip := r.FormValue("local_ip")
if identifier == "" || weave_ipstr == "" || name == "" || prefix == "" || local_ip == "" {
log.Printf("Invalid request: %s, %s", r.URL, r.Form)
http.Error(w, "Invalid Request", http.StatusBadRequest)
return
}
ip := net.ParseIP(local_ip)