From 7242c7ce9582f7866cf1eab1b6d04da65e12e4d3 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 5 Jan 2020 11:24:15 +0000 Subject: [PATCH] s3: fix multipart upload uploading 0 length files This regression was introduced by the recent re-write of the s3 multipart upload code. --- backend/s3/s3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 4aa3bd8a0..68b78641d 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -2127,7 +2127,7 @@ func (o *Object) uploadMultipart(ctx context.Context, req *s3.PutObjectInput, si var n int n, err = readers.ReadFill(in, buf) // this can never return 0, nil if err == io.EOF { - if n == 0 { + if n == 0 && partNum != 1 { // end if no data and if not first chunk break } finished = true