object: PutObjectHandler should set the md5Sum properly. (#1604)

Additionally add a test case as well for validating for us
to reply BadDigest properly.

Fixes #1603
This commit is contained in:
Harshavardhana
2016-05-11 16:13:37 -07:00
parent adbcafefad
commit d4745c7d6a
2 changed files with 42 additions and 3 deletions

View File

@@ -603,7 +603,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req
// Save metadata.
metadata := make(map[string]string)
// Make sure we hex encode here.
metadata["md5"] = hex.EncodeToString(md5Bytes)
metadata["md5Sum"] = hex.EncodeToString(md5Bytes)
// Create object.
md5Sum, err = api.ObjectAPI.PutObject(bucket, object, size, reader, metadata)
}