From a824be08b40b9c979c78a6d0375f58e7ecf36de4 Mon Sep 17 00:00:00 2001 From: euri10 Date: Tue, 14 Jun 2022 09:38:01 +0200 Subject: [PATCH] Revert log exception traceback in case of invalid HTTP request (#1518) * Revert "Log exception traceback in case of invalid HTTP request when using h11 (#889)" This reverts commit 2e17dd9f * Revert "Log exception traceback in case of invalid HTTP request when using httptools (#886)" This reverts commit 305ed0e2 --- uvicorn/protocols/http/h11_impl.py | 4 ++-- uvicorn/protocols/http/httptools_impl.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/uvicorn/protocols/http/h11_impl.py b/uvicorn/protocols/http/h11_impl.py index 1767f55970..1b52ea1a20 100644 --- a/uvicorn/protocols/http/h11_impl.py +++ b/uvicorn/protocols/http/h11_impl.py @@ -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) diff --git a/uvicorn/protocols/http/httptools_impl.py b/uvicorn/protocols/http/httptools_impl.py index e932b74b04..1135ae493e 100644 --- a/uvicorn/protocols/http/httptools_impl.py +++ b/uvicorn/protocols/http/httptools_impl.py @@ -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: