Skip to content

Commit

Permalink
Merge pull request #26 from jlagnese-allata/master
Browse files Browse the repository at this point in the history
Another fix required for correct signature using query string arrays
  • Loading branch information
tsibelman authored May 12, 2020
2 parents 701e47f + 35d9864 commit 8f05baf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Aws4Signer/AWS4RequestSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ private static string GetCanonicalQueryParams(HttpRequestMessage request)
}
else
{
// Query params must be escaped in upper case (i.e. "%2C", not "%2c").
// Handles multiple values per query parameter
var queryValues = querystring[key].Split(',').Select(v => $"{Uri.EscapeDataString(key)}={Uri.EscapeDataString(v)}");
var queryValues = querystring[key].Split(',')
// Order by value alphanumerically (required for correct canonical string)
.OrderBy(v => v)
// Query params must be escaped in upper case (i.e. "%2C", not "%2c").
.Select(v => $"{Uri.EscapeDataString(key)}={Uri.EscapeDataString(v)}");

values.Add(Uri.EscapeDataString(key), queryValues);
}
Expand Down

0 comments on commit 8f05baf

Please sign in to comment.