Open aleclarson opened 2 years ago
According to https://nodejs.org/api/crypto.html#hashupdatedata-inputencoding, hash.update()
will ignore the given encoding ('utf8'
here) when the given data (string
here) is already a Buffer
. So maybe it already admits body
as a Buffer
? Admittedly, I haven't tested this.
…and it shouldn't assume UTF8 encoding.
Currently, when calculating the content hash, UTF8 encoding is assumed: https://github.com/mhart/aws4/blob/a413aadd9e4b4e58842937a9ad53354be41ef4a1/aws4.js#L14-L15