fs: PutObject create 0byte objects properly. (#3387)

Current code always appends to a file only if 1byte or
more was sent on the wire was affecting both PutObject
and PutObjectPart uploads.

This patch fixes such a situation and resolves #3385
This commit is contained in:
Harshavardhana
2016-12-03 11:53:12 -08:00
committed by GitHub
parent 67509453d3
commit cf17fc7774
4 changed files with 39 additions and 42 deletions

View File

@@ -301,6 +301,7 @@ func (fs fsObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
fs.storage.DeleteFile(minioMetaTmpBucket, tmpPartPath)
return "", toObjectErr(cErr, minioMetaTmpBucket, tmpPartPath)
}
// Should return IncompleteBody{} error when reader has fewer
// bytes than specified in request header.
if bytesWritten < size {