Skip to content

Commit

Permalink
Log exception traceback in case of invalid HTTP request when using ht…
Browse files Browse the repository at this point in the history
…tptools (encode#886)
  • Loading branch information
florimondmanca authored Dec 12, 2020
1 parent 1f282e0 commit 305ed0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uvicorn/protocols/http/httptools_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ def data_received(self, data):

try:
self.parser.feed_data(data)
except httptools.HttpParserError:
except httptools.HttpParserError as exc:
msg = "Invalid HTTP request received."
self.logger.warning(msg)
self.logger.warning(msg, exc_info=exc)
self.transport.close()
except httptools.HttpParserUpgrade:
self.handle_upgrade()
Expand Down

0 comments on commit 305ed0e

Please sign in to comment.