Skip to content

Commit

Permalink
Revert log exception traceback in case of invalid HTTP request (#1518)
Browse files Browse the repository at this point in the history
* Revert "Log exception traceback in case of invalid HTTP request when using h11 (#889)"

This reverts commit 2e17dd9

* Revert "Log exception traceback in case of invalid HTTP request when using httptools (#886)"

This reverts commit 305ed0e
  • Loading branch information
euri10 committed Jun 14, 2022
1 parent 5f999c3 commit f4bb5ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions uvicorn/protocols/http/h11_impl.py
Expand Up @@ -162,9 +162,9 @@ def handle_events(self) -> None:
while True:
try:
event = self.conn.next_event()
except h11.RemoteProtocolError as exc:
except h11.RemoteProtocolError:
msg = "Invalid HTTP request received."
self.logger.warning(msg, exc_info=exc)
self.logger.warning(msg)
self.send_400_response(msg)
return
event_type = type(event)
Expand Down
4 changes: 2 additions & 2 deletions uvicorn/protocols/http/httptools_impl.py
Expand Up @@ -149,9 +149,9 @@ def data_received(self, data: bytes) -> None:

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

0 comments on commit f4bb5ea

Please sign in to comment.