mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Wasn't reading body not that it's using FormValue for some reason. Moved body read up.
This commit is contained in:
@@ -98,17 +98,17 @@ func ProxyFunc(w http.ResponseWriter, req *http.Request) {
|
|||||||
func AddWorker(w http.ResponseWriter, req *http.Request) {
|
func AddWorker(w http.ResponseWriter, req *http.Request) {
|
||||||
log.Println("AddWorker called!")
|
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{}
|
r2 := Route2{}
|
||||||
decoder := json.NewDecoder(req.Body)
|
decoder := json.NewDecoder(req.Body)
|
||||||
decoder.Decode(&r2)
|
decoder.Decode(&r2)
|
||||||
// todo: do we need to close body?
|
// todo: do we need to close body?
|
||||||
fmt.Println("DECODED:", r2)
|
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: routing table should be in mongo (or IronCache?) so all routers can update/read from it.
|
||||||
// todo: one cache entry per host domain
|
// todo: one cache entry per host domain
|
||||||
route := routingTable[r2.Host]
|
route := routingTable[r2.Host]
|
||||||
|
|||||||
Reference in New Issue
Block a user