From 834007728c7700ca40962559c1bf46fac0afcc93 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 29 Nov 2016 16:47:01 -0800 Subject: [PATCH] fs: Do not print redundant md5Sum response header. (#3369) For both GET and HEAD requests. --- cmd/fs-v1.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/fs-v1.go b/cmd/fs-v1.go index fe71932fd..37ff64032 100644 --- a/cmd/fs-v1.go +++ b/cmd/fs-v1.go @@ -330,8 +330,7 @@ func (fs fsObjects) getObjectInfo(bucket, object string) (ObjectInfo, error) { } } - // Guess content-type from the extension if possible. - return ObjectInfo{ + objInfo := ObjectInfo{ Bucket: bucket, Name: object, ModTime: fi.ModTime, @@ -340,8 +339,15 @@ func (fs fsObjects) getObjectInfo(bucket, object string) (ObjectInfo, error) { MD5Sum: fsMeta.Meta["md5Sum"], ContentType: fsMeta.Meta["content-type"], ContentEncoding: fsMeta.Meta["content-encoding"], - UserDefined: fsMeta.Meta, - }, nil + } + + // md5Sum has already been extracted into objInfo.MD5Sum. We + // need to remove it from fsMeta.Meta to avoid it from appearing as + // part of response headers. e.g, X-Minio-* or X-Amz-*. + delete(fsMeta.Meta, "md5Sum") + objInfo.UserDefined = fsMeta.Meta + + return objInfo, nil } // GetObjectInfo - get object info.