Skip to content

Commit

Permalink
move comment
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Dec 5, 2022
1 parent eda8b4f commit 443955d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ func (t *Transport) CloseIdleConnections() {
// cloner returns a function which makes clones of the provided request
func cloner(req *http.Request) (func() (*http.Request, error), error) {
getbody := req.GetBody
// if there's no GetBody function set we have to copy the body
// into memory to use for future clones
if getbody == nil && req.Body != nil {
// if there's no GetBody function set we have to copy the body
// into memory to use for future clones
// optimise http.NoBody
if req.Body == http.NoBody {
getbody = func() (io.ReadCloser, error) {
return http.NoBody, nil
Expand Down

0 comments on commit 443955d

Please sign in to comment.