Skip to content

Commit

Permalink
Fix copyobject failure for empty files (#918)
Browse files Browse the repository at this point in the history
Fix CopyObject API to do a single part put object s3 api call, if
the object to be copied is empty.

Required fix for minio/mc#2384
  • Loading branch information
kannappanr authored Feb 6, 2018
1 parent ff08912 commit 706c81d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api-compose-object.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ func (c Client) ComposeObject(dst DestinationInfo, srcs []SourceInfo) error {

// Single source object case (i.e. when only one source is
// involved, it is being copied wholly and at most 5GiB in
// size).
if totalParts == 1 && srcs[0].start == -1 && totalSize <= maxPartSize {
// size, emptyfiles are also supported).
if (totalParts == 1 && srcs[0].start == -1 && totalSize <= maxPartSize) || (totalSize == 0) {
h := srcs[0].Headers
// Add destination encryption headers
for k, v := range dst.encryption.getSSEHeaders(false) {
Expand Down

0 comments on commit 706c81d

Please sign in to comment.