-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Don't propagate the status received from Discord to GitHub Webhook #1281
Conversation
✅ Deploy Preview for pydis-static ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
pydis_site/apps/api/views.py
Outdated
headers.pop('Connection', None) | ||
headers.pop('Content-Length', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to do this anymore, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot, removed in 346d570
pydis_site/apps/api/views.py
Outdated
|
||
response_body = { | ||
"original_status": response_status, | ||
"data": body.decode("utf-8"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does GH know it has to look in this nested structure now instead of the root?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't -- but it doesn't need to, GitHub stores all response details for us to browse, it doesn't do any processing of this response. I'm going to add a sanity log on our side though to mark when we get a 400 from downstream (but without logging sensitive info).
229d8fb
to
891df20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great
891df20
to
3d04acc
Compare
When we received a bad request exception from Discord (which is not actually representative of an error here), we were propagating this back to GitHub.
Instead, we should always return a success request if we have been successful in the proxy attempt, and return the downstream status code as a part of the response body.
This prevents GitHub Webhook Bad Requests being logged to site logs.