瀏覽代碼

Final push

Toby Chui 3 年之前
父節點
當前提交
137256c173
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      mod/agi/agi.http.go

+ 1 - 1
mod/agi/agi.http.go

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