Skip to content

Fix validateWebhook backwards incompatibility with older Node.js #298

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

jakedahn
Copy link
Contributor

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 merged commit 0cf57c4 into replicate:main Aug 29, 2024
25 of 36 checks passed
@mattt
Copy link
Contributor

mattt commented Aug 29, 2024

Thanks, @jakedahn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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)
2 participants