req body close

This commit is contained in:
eson 2018-12-18 01:04:32 +08:00
parent 1f673f991f
commit 18de9c2c1f

View File

@ -299,7 +299,6 @@ func setTempCookieRequest(req *http.Request, wf *Workflow) {
func (wf *Workflow) Execute() (*Response, error) { func (wf *Workflow) Execute() (*Response, error) {
req := buildBodyRequest(wf) req := buildBodyRequest(wf)
defer req.Body.Close()
setHeaderRequest(req, wf) setHeaderRequest(req, wf)
setTempCookieRequest(req, wf) setTempCookieRequest(req, wf)
@ -312,5 +311,7 @@ func (wf *Workflow) Execute() (*Response, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer req.Body.Close()
return FromHTTPResponse(resp) return FromHTTPResponse(resp)
} }