-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Hi
When using an imported request body with an AWS request, I get the following error:
{
"__type": "com.amazon.coral.service#InvalidSignatureException",
"message": "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details...."
}The request works fine using an inline request body. The difference being that the body is not passed to the AWS signer when using an imported request body:
Looking at the body sent in to the awsAuthVariableReplacer.
For the inline request it is (as expected):
"{\"queueUrl\":\"https://sqs.us-east-2.amazonaws.com/000000000000/queue\",\"message\":\"test\"}"For the imported request, it is an array containing a buffer and an empty string:
[ Buffer<...>, ' ' ]The awsAuthVariableReplacer only expects the body to be a Buffer or string:
body: Buffer.isBuffer(request.body) || utils.isString(request.body) ? request.body : undefined,I used git bisect to trace the problem back to this commit: b754ab7.
I've got a branch to fix the issue, but I'm not sure if it's the best solution (hence no PR) as it will end up transforming the body twice:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels