@@ -17,6 +17,8 @@ class SignatureTestSuite: XCTestCase {
1717 ( " testGetVanilla " , testGetVanilla) ,
1818 ( " testGetVanillaQuery " , testGetVanillaQuery) ,
1919 ( " testGetVanillaEmptyQueryKey " , testGetVanillaEmptyQueryKey) ,
20+ ( " testGetVanillaQueryUnreserved " , testGetVanillaQueryUnreserved) ,
21+ ( " testGetVanillaQueryUTF8 " , testGetVanillaQueryUTF8) ,
2022 ( " testPostVanilla " , testPostVanilla) ,
2123 ( " testPostVanillaQuery " , testPostVanillaQuery) ,
2224 ( " testPostVanillaQueryNonunreserved " , testPostVanillaQueryNonunreserved)
@@ -146,6 +148,24 @@ class SignatureTestSuite: XCTestCase {
146148 )
147149 }
148150
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+
149169 func testPostVanilla( ) {
150170 let expectedCanonicalRequest = " POST \n / \n \n host:example.amazonaws.com \n x-amz-date:20150830T123600Z \n \n host;x-amz-date \n e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 "
151171
0 commit comments