response: Don't use bufReadCloser

This commit is contained in:
Adnan Maolood
2021-03-20 13:41:53 -04:00
parent a40b5dcd0b
commit 3dca29eb41
2 changed files with 5 additions and 29 deletions

View File

@@ -81,7 +81,11 @@ func ReadResponse(r io.ReadCloser) (*Response, error) {
resp.Meta = string(meta)
if resp.Status.Class() == StatusSuccess {
resp.Body = newBufReadCloser(br, r)
type readCloser struct {
io.Reader
io.Closer
}
resp.Body = readCloser{br, r}
} else {
resp.Body = nopReadCloser{}
r.Close()