From 0378b56873f604080b0900f29a83a861c464d4cb Mon Sep 17 00:00:00 2001 From: euri10 Date: Mon, 13 Jun 2022 17:14:30 +0200 Subject: [PATCH 1/2] Revert "Log exception traceback in case of invalid HTTP request when using h11 (#889)" This reverts commit 2e17dd9f --- uvicorn/protocols/http/h11_impl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uvicorn/protocols/http/h11_impl.py b/uvicorn/protocols/http/h11_impl.py index 1767f5597..1b52ea1a2 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) From 699d97eae50c5e9b52b891e5da469e0a75e379f1 Mon Sep 17 00:00:00 2001 From: euri10 Date: Mon, 13 Jun 2022 17:14:42 +0200 Subject: [PATCH 2/2] Revert "Log exception traceback in case of invalid HTTP request when using httptools (#886)" This reverts commit 305ed0e2 --- uvicorn/protocols/http/httptools_impl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uvicorn/protocols/http/httptools_impl.py b/uvicorn/protocols/http/httptools_impl.py index e932b74b0..1135ae493 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: