Skip to content

Commit

Permalink
Log exception traceback in case of invalid HTTP request when using h11 (
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca authored Dec 12, 2020
1 parent 5512965 commit 2e17dd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uvicorn/protocols/http/h11_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ def handle_events(self):
while True:
try:
event = self.conn.next_event()
except h11.RemoteProtocolError:
except h11.RemoteProtocolError as exc:
msg = "Invalid HTTP request received."
self.logger.warning(msg)
self.logger.warning(msg, exc_info=exc)
self.transport.close()
return
event_type = type(event)
Expand Down

0 comments on commit 2e17dd9

Please sign in to comment.