This PR removes the JSON.parse call from event.body. This was causing issues when trying to invoke Lambda functions asynchronously with async set to true in a serverless.yaml config file. I'm not exactly sure why this doesn't cause issues when async is not set to true, but I tested these changes with http events (both async: true and async: false) and httpApi events and it seemed to work fine on both. Also, I believe the verifyAndReceive function internally handles both objects and strings anyway.
Fixes #78.
This PR removes the
JSON.parse
call fromevent.body
. This was causing issues when trying to invoke Lambda functions asynchronously withasync
set totrue
in aserverless.yaml
config file. I'm not exactly sure why this doesn't cause issues whenasync
is not set totrue
, but I tested these changes withhttp
events (bothasync: true
andasync: false
) andhttpApi
events and it seemed to work fine on both. Also, I believe theverifyAndReceive
function internally handles both objects and strings anyway.