diff --git a/response.go b/response.go index 568507b..66b5e6f 100644 --- a/response.go +++ b/response.go @@ -82,6 +82,8 @@ func ReadResponse(rc io.ReadCloser) (*Response, error) { if resp.Status.Class() == StatusClassSuccess { resp.Body = newReadCloserBody(br, rc) + } else { + rc.Close() } return resp, nil }