Skip to content

Commit 495b6d5

Browse files
Oliver Hookinskr
Oliver Hookins
authored andcommitted
Add restore to the list of canonicalized sub resources.
1 parent 317e889 commit 495b6d5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

sign.go

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var signParams = map[string]bool{
3030
"response-content-language": true,
3131
"response-content-type": true,
3232
"response-expires": true,
33+
"restore": true,
3334
"torrent": true,
3435
"uploadId": true,
3536
"uploads": true,

sign_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ var signTest = []struct {
147147
// Doesn't match the example in the Amazon docs
148148
"AWS AKIAIOSFODNN7EXAMPLE:DXGmXMY+1QnRGC7vicUqu1gTmK4=",
149149
},
150+
{
151+
DefaultService,
152+
"POST",
153+
// object?restore is required in CanonicalizedResource for:
154+
// http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOSTrestore.html
155+
"http://bucketname.S3.amazonaws.com/photo1.jpg?restore",
156+
http.Header{
157+
"x-amz-date": {"Mon, 22 Oct 2012 01:49:52 GMT"},
158+
"Content-MD5": {"p5/WA/oEr30qrEEl21PAqw=="},
159+
"Content-Length": {"125"},
160+
},
161+
"POST\np5/WA/oEr30qrEEl21PAqw==\n\n\nx-amz-date:Mon, 22 Oct 2012 01:49:52 GMT\n/bucketname/photo1.jpg?restore",
162+
"AWS AKIAIOSFODNN7EXAMPLE:Yuldf0uSoOutFCGMkKYQzxVYeDk=",
163+
},
150164
{
151165
StorageIOService,
152166
"GET",

0 commit comments

Comments
 (0)