diff options
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/api-compose-object.go')
-rw-r--r-- | vendor/github.com/minio/minio-go/v7/api-compose-object.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/api-compose-object.go b/vendor/github.com/minio/minio-go/v7/api-compose-object.go index edcd44e74a..40238de35f 100644 --- a/vendor/github.com/minio/minio-go/v7/api-compose-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-compose-object.go @@ -202,7 +202,7 @@ func (opts CopySrcOptions) validate() (err error) { // Low level implementation of CopyObject API, supports only upto 5GiB worth of copy. func (c Client) copyObjectDo(ctx context.Context, srcBucket, srcObject, destBucket, destObject string, - metadata map[string]string, dstOpts PutObjectOptions) (ObjectInfo, error) { + metadata map[string]string, srcOpts CopySrcOptions, dstOpts PutObjectOptions) (ObjectInfo, error) { // Build headers. headers := make(http.Header) @@ -240,7 +240,9 @@ func (c Client) copyObjectDo(ctx context.Context, srcBucket, srcObject, destBuck // Set the source header headers.Set("x-amz-copy-source", s3utils.EncodePath(srcBucket+"/"+srcObject)) - + if srcOpts.VersionID != "" { + headers.Set("x-amz-copy-source", s3utils.EncodePath(srcBucket+"/"+srcObject)+"?versionId="+srcOpts.VersionID) + } // Send upload-part-copy request resp, err := c.executeMethod(ctx, http.MethodPut, reqMetadata) defer closeResponse(resp) |