From 18de9c2c1f8f5e13c4407417312ee70e9f8270f1 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Tue, 18 Dec 2018 01:04:32 +0800 Subject: [PATCH] req body close --- workflow.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow.go b/workflow.go index 6469aee..478dbb7 100644 --- a/workflow.go +++ b/workflow.go @@ -299,7 +299,6 @@ func setTempCookieRequest(req *http.Request, wf *Workflow) { func (wf *Workflow) Execute() (*Response, error) { req := buildBodyRequest(wf) - defer req.Body.Close() setHeaderRequest(req, wf) setTempCookieRequest(req, wf) @@ -312,5 +311,7 @@ func (wf *Workflow) Execute() (*Response, error) { if err != nil { return nil, err } + + defer req.Body.Close() return FromHTTPResponse(resp) }