We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried using this to handle webhook requests and I kept seeing 400 Bad Request responses:
400 Bad Request
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>400 Bad Request</title> <h1>Bad Request</h1> <p>Invalid signature</p>
After a bit of investigation I found out that this fails because request.data is empty:
request.data
python-github-webhook/github_webhook/webhook.py
Lines 56 to 59 in 61e713c
request.get_data()
Request.get_data(cache=True, as_text=False, parse_form_data=False) This reads the buffered incoming data from the client into one bytestring. By default this is cached but that behavior can be changed by setting cache to False. https://tedboy.github.io/flask/generated/generated/flask.Request.get_data.html
Request.get_data(cache=True, as_text=False, parse_form_data=False)
Not sure how this worked before...
The text was updated successfully, but these errors were encountered:
Thanks, @ jakubgs, this worked for me!
Sorry, something went wrong.
No branches or pull requests
I tried using this to handle webhook requests and I kept seeing
400 Bad Request
responses:After a bit of investigation I found out that this fails because
request.data
is empty:python-github-webhook/github_webhook/webhook.py
Lines 56 to 59 in 61e713c
And what should be used instead is
request.get_data()
, since it returns value regardless off payload format used:Not sure how this worked before...
The text was updated successfully, but these errors were encountered: