From b89609dc2e5583e66f892a3130264e8b6bb7d820 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Mon, 17 Oct 2016 21:11:33 +0530 Subject: [PATCH] XL: Filter out md5Sum from user defined headers (#2962) --- cmd/xl-v1-object.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/xl-v1-object.go b/cmd/xl-v1-object.go index 2f7c7353c..d67a515fc 100644 --- a/cmd/xl-v1-object.go +++ b/cmd/xl-v1-object.go @@ -259,8 +259,14 @@ func (xl xlObjects) getObjectInfo(bucket, object string) (objInfo ObjectInfo, er MD5Sum: xlMetaMap["md5Sum"], ContentType: xlMetaMap["content-type"], ContentEncoding: xlMetaMap["content-encoding"], - UserDefined: xlMetaMap, } + + // md5Sum has already been extracted into objInfo.MD5Sum. We + // need to remove it from xlMetaMap to avoid it from appearing as + // part of response headers. e.g, X-Minio-* or X-Amz-*. + + delete(xlMetaMap, "md5Sum") + objInfo.UserDefined = xlMetaMap return objInfo, nil }