octokit / webhooks.js

GitHub webhook events toolset for Node.js
MIT License
307 stars 80 forks source link

[BUG]: Preparsed payloads are not handled correctly, here Vercel #961

Open Uzlopak opened 5 months ago

Uzlopak commented 5 months ago

What happened?

https://github.com/probot/probot/issues/1955#issuecomment-1919925057

The issue arises from the fact, that vercel preparses the body. So verify can not verify the body, as it is not a string.

You can get it to work for now, by setting the NODEJS_HELPERS environment variable to 0 in vercel.

Versions

current

Relevant log output

No response

Code of Conduct

github-actions[bot] commented 5 months ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

wolfy1339 commented 5 months ago

It could be nice to document this, other platforms probably have similar issues

gr2m commented 4 months ago

follow up to https://github.com/probot/probot/issues/1973#issuecomment-1937111521. I would throw a helpful error if anything but a string is passed to the verify method. We should probably do that in https://github.com/octokit/webhooks-methods.js. It seems right now both verify and sign silently accept objects although the types define string for the payload

wolfy1339 commented 4 months ago

An error has been added to @octokit/webhooks-methods whenever object payloads are passed. Is there anything else actionable in this issue?