Skip to content

Commit

Permalink
fix issue: request body was closed while retrying in callRequest meth…
Browse files Browse the repository at this point in the history
…od (#3199)
  • Loading branch information
zhangyuyu authored Dec 14, 2023
1 parent ee2cf92 commit 3358450
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/gclient/gclient_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ func (c *Client) callRequest(req *http.Request) (resp *Response, err error) {
// raw HTTP request-response procedure.
reqBodyContent, _ := io.ReadAll(req.Body)
resp.requestBody = reqBodyContent
req.Body = utils.NewReadCloser(reqBodyContent, false)
for {
req.Body = utils.NewReadCloser(reqBodyContent, false)
if resp.Response, err = c.Do(req); err != nil {
err = gerror.Wrapf(err, `request failed`)
// The response might not be nil when err != nil.
Expand Down

0 comments on commit 3358450

Please sign in to comment.