s3: do not close reader too early

fix https://github.com/chrislusf/seaweedfs/issues/1609
This commit is contained in:
Chris Lu 2020-11-11 01:49:39 -08:00
parent 15956d8a8e
commit 73f934d5de

View file

@ -370,7 +370,6 @@ func ReadUrlAsReaderCloser(fileUrl string, rangeHeader string) (io.ReadCloser, e
if err != nil {
return nil, err
}
defer CloseResponse(r)
if r.StatusCode >= 400 {
return nil, fmt.Errorf("%s: %s", fileUrl, r.Status)
}