@@ -17,6 +17,8 @@ class SignatureTestSuite: XCTestCase {
17
17
( " testGetVanilla " , testGetVanilla) ,
18
18
( " testGetVanillaQuery " , testGetVanillaQuery) ,
19
19
( " testGetVanillaEmptyQueryKey " , testGetVanillaEmptyQueryKey) ,
20
+ ( " testGetVanillaQueryUnreserved " , testGetVanillaQueryUnreserved) ,
21
+ ( " testGetVanillaQueryUTF8 " , testGetVanillaQueryUTF8) ,
20
22
( " testPostVanilla " , testPostVanilla) ,
21
23
( " testPostVanillaQuery " , testPostVanillaQuery) ,
22
24
( " testPostVanillaQueryNonunreserved " , testPostVanillaQueryNonunreserved)
@@ -146,6 +148,24 @@ class SignatureTestSuite: XCTestCase {
146
148
)
147
149
}
148
150
151
+ func testGetVanillaQueryUTF8( ) {
152
+ let expectedCanonicalRequest = " GET \n / \n %E1%88%B4=bar \n host:example.amazonaws.com \n x-amz-date:20150830T123600Z \n \n host;x-amz-date \n e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 "
153
+
154
+ let expectedCredentialScope = " 20150830/us-east-1/service/aws4_request "
155
+
156
+ let expectedCanonicalHeaders : [ HeaderKey : String ] = [
157
+ " X-Amz-Date " : " 20150830T123600Z " ,
158
+ " Authorization " : " AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=2cdec8eed098649ff3a119c94853b13c643bcf08f8b0a1d91e12c9027818dd04 "
159
+ ]
160
+
161
+ let result = sign ( method: . get, path: " / " , requestParam: " ሴ=bar " )
162
+ result. expect (
163
+ canonicalRequest: expectedCanonicalRequest,
164
+ credentialScope: expectedCredentialScope,
165
+ canonicalHeaders: expectedCanonicalHeaders
166
+ )
167
+ }
168
+
149
169
func testPostVanilla( ) {
150
170
let expectedCanonicalRequest = " POST \n / \n \n host:example.amazonaws.com \n x-amz-date:20150830T123600Z \n \n host;x-amz-date \n e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 "
151
171
0 commit comments