Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix validateWebhook backwards incompatibility with Node 18.x #299

Closed
wants to merge 2 commits into from

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Aug 29, 2024

Duplicate of #298, but opened on a branch rather than a fork to run integration tests.


This pull request fixes: #297


To make the validateWebhook function backward compatible with Node.js 18.x and Next.js 12.x, we need to access the headers with a slightly different syntax.

After making that adjustment, I also discovered a version incompatibility with the requestData.body value. I fixed that by stringifying the requestData.body, and then the validateWebhook function started working as expected.

@mattt mattt closed this Aug 29, 2024
@mattt mattt deleted the mattt/fix-validate-webhook-node-18 branch August 29, 2024 12:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The validateWebhook function crashes in nodejs v0.18.x when called from Next.js 12.1.0 (pages router)
1 participant