Skip to content

Commit

Permalink
When there is no response body, no response data is read.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoger committed Dec 11, 2020
1 parent b6c8f2b commit ad14af3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"encoding/xml"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
)
Expand Down Expand Up @@ -71,7 +70,6 @@ func NewResponse(o *http.Response, noBody bool) (Response, error) {
headers: o.Header.Clone(),
}
if noBody {
_, _ = io.Copy(ioutil.Discard, o.Body)
return res, nil
}
if body, err := ioutil.ReadAll(o.Body); err != nil {
Expand Down

0 comments on commit ad14af3

Please sign in to comment.