{"action":"opened","issue":{"url":"https://api.github.com/repos/minio/minio/issues/2125","repository_url":"https://api.github.com/repos/minio/minio","labels_url":"https://api.github.com/repos/minio/minio/issues/2125/labels{/name}","comments_url":"https://api.github.com/repos/minio/minio/issues/2125/comments","events_url":"https://api.github.com/repos/minio/minio/issues/2125/events","html_url":"https://github.com/minio/minio/issues/2125","id":164280602,"number":2125,"title":"ETag does not return in HeadObject response headers","user":{"login":"amelkikh","id":5112566,"avatar_url":"https://avatars.githubusercontent.com/u/5112566?v=3","gravatar_id":"","url":"https://api.github.com/users/amelkikh","html_url":"https://github.com/amelkikh","followers_url":"https://api.github.com/users/amelkikh/followers","following_url":"https://api.github.com/users/amelkikh/following{/other_user}","gists_url":"https://api.github.com/users/amelkikh/gists{/gist_id}","starred_url":"https://api.github.com/users/amelkikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amelkikh/subscriptions","organizations_url":"https://api.github.com/users/amelkikh/orgs","repos_url":"https://api.github.com/users/amelkikh/repos","events_url":"https://api.github.com/users/amelkikh/events{/privacy}","received_events_url":"https://api.github.com/users/amelkikh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-07T10:43:18Z","updated_at":"2016-07-07T10:43:18Z","closed_at":null,"body":"Expected standard http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectHEAD.html\r\n\r\nStep by step, I have studied the code.\r\nI do not know the language well enough to write a fix, however, I understand that the metadata is not preserved. In particular, the hash sum, which is necessary for the response header\r\n\r\nhttps://github.com/minio/minio/blob/master/object-handlers.go#L296\r\nhttps://github.com/minio/minio/blob/master/api-headers.go#L71\r\n```\r\n...\r\nif objInfo.MD5Sum != \"\" {\r\n\t\tw.Header().Set(\"ETag\", \"\\\"\"+objInfo.MD5Sum+\"\\\"\")\r\n}\r\n...\r\n```\r\n## Expected behaviour\r\nSample Request\r\n```\r\nHEAD /my-bucket/my-image.jpg HTTP/1.1\r\nHost: s3.my-local-storage.docker\r\nDate: Wed, 28 Oct 2009 22:32:00 GMT\r\nAuthorization: comeAuthCode\r\n```\r\nExpected response\r\n\r\n```\r\nHTTP/1.1 200 OK\r\nx-amz-request-id: 318BC8BC143432E5\r\nDate: Wed, 28 Oct 2009 22:32:00 GMT\r\nLast-Modified: Sun, 1 Jan 2006 12:00:00 GMT\r\nETag: \"fba9dede5f27731c9771645a39863328\"\r\nContent-Length: 434234\r\nContent-Type: text/plain\r\nConnection: close\r\nServer: my-server\r\nSomething: Else\r\n```\r\n## Actual behaviour\r\nActual Response\r\n\r\n```\r\nHTTP/1.1 200 OK\r\nx-amz-request-id: 318BC8BC143432E5\r\nDate: Wed, 28 Oct 2009 22:32:00 GMT\r\nLast-Modified: Sun, 1 Jan 2006 12:00:00 GMT\r\nETag:\r\nContent-Length: 434234\r\nContent-Type: text/plain\r\nConnection: close\r\nServer: my-server\r\nSomething: Else\r\n```\r\n\r\n## Steps to reproduce the behaviour\r\nIn docker according to instructions https://hub.docker.com/r/minio/minio/\r\nPhp 5.6, Yii2 and official aws-sdk-php\r\nhttps://packagist.org/packages/aws/aws-sdk-php\r\n\r\n## Minio version\r\n- (paste output of `minio version`)\r\n\r\n## System information\r\nPlatform \r\nOS: linux | Arch: amd64\r\nRuntime\r\nVersion: go1.6.2 | CPUs: 4\r\n\r\n\r\n"}}
{"actor":{"display_login":"amelkikh"}}