Skip to content
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

Fix TypeError while validating webhook signature(Fix #121) #146

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

namantam1
Copy link

@namantam1 namantam1 commented Jul 19, 2021

I have fixed issue #121 created by @niketnishi.

What was the issue I tried to fix -

  • When razorpay send a post request for a particular webhook then it send the body as raw which we get as bytes object already. which I observed in Flask and Django, I am not sure about other frameworks.
  • So when we pass the body to verify_webhook_signature then it parse the body to bytes object first which if already a bytes like object raises a TypeError.

Changes made -

  • Add a check for bytes object of key and body before making the digest signature.
  • Add a test for above implementation.

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.

None yet

1 participant