Skip to content

Commit

Permalink
Merge pull request #169 from ddosify/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
fatihbaltaci authored Apr 14, 2023
2 parents 4c2b254 + f727bfa commit 77bbbe0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/scenario/requester/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,13 @@ func (h *HttpRequester) Send(client *http.Client, envs map[string]interface{}) (
return res
}

io.Copy(&copiedReqBody, httpReq.Body)
httpReq.Body = io.NopCloser(bytes.NewReader(copiedReqBody.Bytes()))
if h.debug {
// copy req body for debug
if httpReq.Body != nil {
io.Copy(&copiedReqBody, httpReq.Body)
httpReq.Body = io.NopCloser(bytes.NewReader(copiedReqBody.Bytes()))
}
}

// Action
httpRes, err := client.Do(httpReq)
Expand Down

0 comments on commit 77bbbe0

Please sign in to comment.