Closed hicham-elmansouri closed 6 years ago
This should help: https://github.com/expressjs/body-parser/issues/83#issuecomment-80782212
Hi @hicham-elmansouri the verify
option is what the actual body is, not sure why it wouldn't work. We would defiantly want to fix it. Can you help us understand what is not working? We would like to get your code working :)
@hicham-elmansouri , @dougwilson I was having a lot of trouble to get this working... No matter what I did I was unable to get the same behavior on my machine and on prod. While on my machine I'd get the body as a Buffer using the method described on the message I posted above on production the body would always be a parsed object.
I used what was described here and got it working.
I GUESS that what seemed to be the issue on my case was this line:
hmac.update(buf, "utf-8");
as I wasn't using the 'utf-8' option.
I'll investigate it further but right now I'm tired :/
I'm sorry if this comment is off-topic, @dougwilson , but I'd like to help someone who had the same issue as I did. I've spent a lot of time to get this working and I guess it shouldn't be this hard.
Yea, definitely. Let us know what can be improved / changed in the module 👍
Closing since there hasn't been any follow up.
I want to implement x-hub-signature verification for facebook messenger chatbot. I invest a lot of time in testing. It looks like that JSON.Stringify(req.body) is not not ok to get the signature match.
Is there a way to get the raw request body using body-parser. Please do not ask if I tried to use verify option. I did it and it doesn't work.
Thanks for you help.