Fix signature v2 handling for resource names (#4965)

Previously we were wrongly adding `?` as part
of the resource name, add a test case to check
if this is handled properly.

Thanks to @kannappanr for reproducing this.

Without this change presigned URL generated with following
command would fail with signature mismatch.
```
aws s3 presign s3://testbucket/functional-tests.sh
```
This commit is contained in:
Harshavardhana
2017-09-26 11:00:07 -07:00
committed by Dee Koder
parent 0bf981278e
commit 6dcfaa877c
3 changed files with 66 additions and 17 deletions

View File

@@ -105,13 +105,18 @@ func TestDoesPresignedV2SignatureMatch(t *testing.T) {
},
expected: ErrSignatureDoesNotMatch,
},
// (6) Should error when the signature does not match.
// (6) Should not error signature matches with extra query params.
{
queryParams: map[string]string{
"response-content-disposition": "attachment; filename=\"4K%2d4M.txt\"",
},
expected: ErrNone,
},
// (7) Should not error signature matches with no special query params.
{
queryParams: map[string]string{},
expected: ErrNone,
},
}
// Run each test case individually.