From bb58040d9ccad511f54b1b772017b60a264efca2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sun, 3 Sep 2023 12:37:20 +0100 Subject: [PATCH] s3: fix multpart streaming uploads of 0 length files --- backend/s3/s3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 2ec6ce98e..02fe34d5f 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -5427,8 +5427,8 @@ func (w *s3ChunkWriter) WriteChunk(ctx context.Context, chunkNumber int, reader if err != nil { return -1, err } - // If no data read, don't write the chunk - if currentChunkSize == 0 { + // If no data read and not the first chunk, don't write the chunk + if currentChunkSize == 0 && chunkNumber != 0 { return 0, nil } md5sumBinary := m.Sum([]byte{})