|
@@ -119,7 +119,6 @@ func (g *Gateway) injectHTTPFunctions(vm *otto.Otto, u *user.User) {
|
|
|
if err != nil || headerKey == "undefined" {
|
|
|
//No headkey set. Return the whole header as JSON
|
|
|
js, _ := json.Marshal(resp.Header)
|
|
|
- log.Println(resp.Header)
|
|
|
returnValue, _ := vm.ToValue(string(js))
|
|
|
return returnValue
|
|
|
} else {
|
|
@@ -159,6 +158,7 @@ func (g *Gateway) injectHTTPFunctions(vm *otto.Otto, u *user.User) {
|
|
|
if err != nil {
|
|
|
return otto.FalseValue()
|
|
|
}
|
|
|
+ defer client.CloseIdleConnections()
|
|
|
vm.Run(`var _location = "` + payload + `";`)
|
|
|
value, _ := otto.ToValue(response.StatusCode)
|
|
|
return value
|