diff --git a/weed/s3api/chunked_reader_v4.go b/weed/s3api/chunked_reader_v4.go index f8f7a3ab3..1b4cf05f3 100644 --- a/weed/s3api/chunked_reader_v4.go +++ b/weed/s3api/chunked_reader_v4.go @@ -284,14 +284,12 @@ func (cr *s3ChunkedReader) Read(buf []byte) (n int, err error) { // If we're using unsigned streaming upload, there is no signature to verify at each chunk. if cr.chunkSignature != "" { cr.state = verifyChunk - continue } else if cr.lastChunk { cr.state = readTrailerChunk - continue } else { cr.state = readChunkHeader - continue } + continue case readTrailerChunk: // When using unsigned upload, this would be the raw contents of the trailer chunk: @@ -409,11 +407,10 @@ func (cr *s3ChunkedReader) Read(buf []byte) (n int, err error) { cr.chunkSHA256Writer.Reset() if cr.lastChunk { cr.state = eofChunk - continue } else { cr.state = readChunkHeader - continue } + continue case eofChunk: return n, io.EOF }