mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
signv2: Do not use path encoding for query values. (#3458)
Use query unescape before comparing signature.
This commit is contained in:
@@ -22,6 +22,7 @@ func TestResourceListSorting(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Tests presigned v2 signature.
|
||||
func TestDoesPresignedV2SignatureMatch(t *testing.T) {
|
||||
root, err := newTestConfig("us-east-1")
|
||||
if err != nil {
|
||||
@@ -76,6 +77,15 @@ func TestDoesPresignedV2SignatureMatch(t *testing.T) {
|
||||
},
|
||||
expected: ErrSignatureDoesNotMatch,
|
||||
},
|
||||
// (5) Should error when the signature does not match.
|
||||
{
|
||||
queryParams: map[string]string{
|
||||
"Expires": fmt.Sprintf("%d", now.Unix()),
|
||||
"Signature": "zOM2YrY/yAQe15VWmT78OlBrK6g=",
|
||||
"AWSAccessKeyId": serverConfig.GetCredential().AccessKeyID,
|
||||
},
|
||||
expected: ErrSignatureDoesNotMatch,
|
||||
},
|
||||
}
|
||||
|
||||
// Run each test case individually.
|
||||
|
||||
Reference in New Issue
Block a user