From dc27c6620fe16725fe763b0b7b5201ab3525cd60 Mon Sep 17 00:00:00 2001 From: Travis Date: Mon, 31 Dec 2012 16:33:22 -0800 Subject: [PATCH] Wasn't reading body not that it's using FormValue for some reason. Moved body read up. --- src/router/router.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/router/router.go b/src/router/router.go index 07a040f1c..bec4304da 100644 --- a/src/router/router.go +++ b/src/router/router.go @@ -98,17 +98,17 @@ func ProxyFunc(w http.ResponseWriter, req *http.Request) { func AddWorker(w http.ResponseWriter, req *http.Request) { log.Println("AddWorker called!") - // get project id and token - projectId := req.FormValue("project_id") - token := req.FormValue("token") - fmt.Println("project_id:", projectId, "token:", token) - r2 := Route2{} decoder := json.NewDecoder(req.Body) decoder.Decode(&r2) // todo: do we need to close body? fmt.Println("DECODED:", r2) + // get project id and token + projectId := req.FormValue("project_id") + token := req.FormValue("token") + fmt.Println("project_id:", projectId, "token:", token) + // todo: routing table should be in mongo (or IronCache?) so all routers can update/read from it. // todo: one cache entry per host domain route := routingTable[r2.Host]