Set etag properly to calculated value if available (#5106)

Fixes #5100
This commit is contained in:
Harshavardhana
2017-10-24 12:25:42 -07:00
committed by Dee Koder
parent 758d5458f0
commit 5eb210dd2e
6 changed files with 26 additions and 18 deletions

View File

@@ -17,6 +17,7 @@
package cmd
import (
"encoding/hex"
"io"
"path"
"strconv"
@@ -579,7 +580,7 @@ func (xl xlObjects) PutObject(bucket string, object string, data *hash.Reader, m
// Save additional erasureMetadata.
modTime := UTCNow()
metadata["etag"] = data.MD5HexString()
metadata["etag"] = hex.EncodeToString(data.MD5Current())
// Guess content-type from the extension if possible.
if metadata["content-type"] == "" {