tsibelman / aws-signer-v4-dot-net

Sign HttpRequestMessage using AWS Signature v4 using request information and credentials.
Apache License 2.0
72 stars 27 forks source link

Read the binary content of a HttpRequestMessage #4

Closed jamievaughan closed 6 years ago

jamievaughan commented 6 years ago

When creating a HttpRequestMessage with a binary payload the Sign method currently reads this content and assumes it is a UTF-8 encoded string. This would then cause issues if one was to use this signing method for a 'PUT' request via an API Gateway.

My changes include modification to the Hash function's parameters to take a byte array as well as reading the content also as a byte array.

The aggregated canonical_request is then encoded to UTF-8 before being hashed.

tsibelman commented 6 years ago

Thank you for this bug fix, I will make a nuget today or tomorrow.

tsibelman commented 6 years ago

I pushed new package