Skip to content

Commit dd1ad42

Browse files
authored
Merge pull request #154 from kbase/dev-exhaust_reader
Exhaust response body on file store
2 parents f7af00b + f28b856 commit dd1ad42

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 0.1.5
22

3+
* Fixed a bug where the response input stream from S3 may not be fully exhausted when
4+
storing a file.
35
* Upgraded from go 1.12 to 1.16, which is now required
46
* Changed build base image from FROM `golang:1.12.5-alpine3.9` to `golang:1.16.15-alpine3.15`
57

filestore/s3.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func (fs *S3FileStore) StoreFile(le *logrus.Entry, p *StoreFileParams) (out *Fil
151151
return nil, errors.New("s3 store request: " + errstr)
152152
}
153153
defer resp.Body.Close()
154+
defer io.Copy(io.Discard, resp.Body)
154155
if resp.StatusCode > 399 { // don't worry about 100s, shouldn't happen
155156
buffer := make([]byte, 1000)
156157
n, err := resp.Body.Read(buffer)

0 commit comments

Comments
 (0)