-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
♻ Instantiate HTTPException
only when needed, optimization refactor
#5356
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5356 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 540 539 -1
Lines 13969 13906 -63
=========================================
- Hits 13969 13906 -63
... and 15 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
📝 Docs preview for commit ceef3e0 at: https://6318590be6f7d21003d370e7--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 👍
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.
Nice!
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, nice catch!
📝 Docs preview for commit 80e7113 at: https://63961f74add2564518f5becd--fastapi.netlify.app |
📝 Docs preview for commit 845d2a4 at: https://639ce44fecf1fd06b69b432b--fastapi.netlify.app |
📝 Docs preview for commit c81b353 at: https://6439025af11ac4226e68ca88--fastapi.netlify.app |
HTTPException
only when needed, optimization refactor
Great, thank you! 🚀 And thanks everyone for the reviews. 🤓 |
Hello, just noticed this while debugging something.
If we enter the condition
if not authorization or scheme.lower() != "basic"
, the instance of HTTPException happens to be unused.I moved it lower to avoid instantiating it without using it.