From 903574db90baef1deda2d480e3a8e7f7d1ccaf47 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Sat, 15 Oct 2016 18:50:56 +0530 Subject: [PATCH] copy-object: Do not use ETag of source as MD5 as it will not be MD5 if source was uploaded as multipart. (#2938) fixes #2934 --- cmd/object-handlers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index 008bb199c..f12466ae0 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -368,8 +368,9 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re // Save other metadata if available. metadata := objInfo.UserDefined - // Do not set `md5sum` as CopyObject will not keep the - // same md5sum as the source. + // Remove the etag from source metadata because if it was uploaded as a multipart object + // then its ETag will not be MD5sum of the object. + delete(metadata, "md5Sum") sha256sum := "" // Create the object.