[BUG]: webhooks.js v12.0.10 onward breaks compatibility with @fastify/middie middleware library #1009
Closed
1 task done
Labels
released
Status: Up for grabs
Issues that are ready to be worked on by anyone
Type: Bug
Something isn't working as documented, or is being fixed
What happened?
Due to a conditional change within
getPayload()
fromif(request.body)
toif("body" in request)
compatibility with the middleware library@fastify/meddie
library is broken. Although this may be an upstream issue with how Middie parses the request, this is an easy fix that was an existing behaviour prior to v12.0.10[0].If
request.body
is undefined, Middie parses this as a defined key with undefined value as apposed to not indulging the body property likenode:http
andexpress
do.I've only inspected middleware request
body
handling withnode:http
,express
,@fastify/express
and@fastify/middie
but this may impact other libraries other than@fastify/middie
.[0] v12.0.9...v12.0.10
Versions
webhooks.js 13.2.6
Relevant log output
No response
Code of Conduct
UPDATE: This may be being fixed upstream within
@fastify/middie
, if attempting to reproduce this bug please use a Middie <=8.3.0. I think the@octokit/webhooks
patch should still be completed as this could be quite difficult to diagnose if the user is on a <=8.3.0 of Middie or if they have constraints for upgrading it.The text was updated successfully, but these errors were encountered: