Ensuring that reader is closed after being read
diff --git a/openstack/objectstorage/v1/objects/results.go b/openstack/objectstorage/v1/objects/results.go
index 719bce9..f7ee75c 100644
--- a/openstack/objectstorage/v1/objects/results.go
+++ b/openstack/objectstorage/v1/objects/results.go
@@ -104,7 +104,7 @@
// DownloadResult is a *http.Response that is returned from a call to the Download function.
type DownloadResult struct {
commonResult
- Body io.Reader
+ Body io.ReadCloser
}
// ExtractContent is a function that takes a DownloadResult's io.Reader body
@@ -120,6 +120,7 @@
if err != nil {
return nil, err
}
+ dr.Body.Close()
return body, nil
}