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 RuntimeError
raised when HTTPException
has a status code with no content
#5365
🐛Fix RuntimeError
raised when HTTPException
has a status code with no content
#5365
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5365 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 540 540
Lines 13936 13951 +15
=========================================
+ Hits 13936 13951 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
📝 Docs preview for commit afecf9b at: https://631a48f65533fb0233157a85--fastapi.netlify.app |
📝 Docs preview for commit f96a078 at: https://631a4cce339597069b76e096--fastapi.netlify.app |
📝 Docs preview for commit c357017 at: https://631a4e7d882b77006ea53e5b--fastapi.netlify.app |
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.
Yep, same idea as what we have in Starlette: https://github.com/encode/starlette/blob/bc61505faef15b673bf4bf65db4927daa354d6b8/starlette/middleware/exceptions.py#L99-L104
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
I was able to find the bug by adding debug points to And thus, the code was referred from Starlette! (Sorry, should have mentioned) |
📝 Docs preview for commit f26af44 at: https://631a5fedd66a3a17d38dcc68--fastapi.netlify.app |
📝 Docs preview for commit fda6d88 at: https://631a9d31d66a3a47438dc97b--fastapi.netlify.app |
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.
LGTM
RuntimeError
raised when HTTPException
has a status code with no content
Awesome, thanks for the fix @iudeen! 🍰 🚀 And thanks for the reviews and comments @Kludex, @JarroVGIT, @BilalAlpaslan 🙇 ☕ |
Fixes/related to #4949 (comment)
Please advice if this approach is correct one.
Suggestions welcome!