diff --git a/s3/responses_test.go b/s3/responses_test.go index 98bba563..fcb7496c 100644 --- a/s3/responses_test.go +++ b/s3/responses_test.go @@ -198,14 +198,15 @@ var InternalErrorDump = ` ` var GetKeyHeaderDump = map[string]string{ - "x-amz-id-2": "ef8yU9AS1ed4OpIszj7UDNEHGran", - "x-amz-request-id": "318BC8BC143432E5", - "x-amz-version-id": "3HL4kqtJlcpXroDTDmjVBH40Nrjfkd", - "Date": "Wed, 28 Oct 2009 22:32:00 GMT", - "Last-Modified": "Sun, 1 Jan 2006 12:00:00 GMT", - "ETag": "fba9dede5f27731c9771645a39863328", - "Content-Length": "434234", - "Content-Type": "text/plain", + "x-amz-id-2": "ef8yU9AS1ed4OpIszj7UDNEHGran", + "x-amz-request-id": "318BC8BC143432E5", + "x-amz-version-id": "3HL4kqtJlcpXroDTDmjVBH40Nrjfkd", + "x-amz-storage-class": "GLACIER", + "Date": "Wed, 28 Oct 2009 22:32:00 GMT", + "Last-Modified": "Sun, 1 Jan 2006 12:00:00 GMT", + "ETag": "fba9dede5f27731c9771645a39863328", + "Content-Length": "434234", + "Content-Type": "text/plain", } var GetListBucketsDump = ` diff --git a/s3/s3.go b/s3/s3.go index dbeec6ef..27f2bbbe 100644 --- a/s3/s3.go +++ b/s3/s3.go @@ -595,6 +595,7 @@ func (b *Bucket) GetKey(path string) (*Key, error) { contentLength, err) } key.Size = size + key.StorageClass = resp.Header.Get("X-Amz-Storage-Class") return key, nil } panic("unreachable") diff --git a/s3/s3_test.go b/s3/s3_test.go index 376c9470..f8422347 100644 --- a/s3/s3_test.go +++ b/s3/s3_test.go @@ -426,6 +426,7 @@ func (s *S) TestGetKey(c *C) { c.Assert(key.LastModified, Equals, GetKeyHeaderDump["Last-Modified"]) c.Assert(key.Size, Equals, int64(434234)) c.Assert(key.ETag, Equals, GetKeyHeaderDump["ETag"]) + c.Assert(key.StorageClass, Equals, GetKeyHeaderDump["x-amz-storage-class"]) } func (s *S) TestUnescapedColon(c *C) {