Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Fill in the StorageClass in getKey. #257

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions s3/responses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down
1 change: 1 addition & 0 deletions s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down