Skip to content

Commit c8472ff

Browse files
authored
fix: do not call JSON.parse on event.body (#89)
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.
1 parent 2c1b25c commit c8472ff

File tree

2 files changed

+25
-8476
lines changed

2 files changed

+25
-8476
lines changed

Diff for: lambda-function.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function lambdaFunction(probot, event, context) {
1818
signature:
1919
headersLowerCase["x-hub-signature-256"] ||
2020
headersLowerCase["x-hub-signature"],
21-
payload: JSON.parse(event.body),
21+
payload: event.body,
2222
});
2323

2424
return {

0 commit comments

Comments
 (0)