From 7199459c69a717bb55f932230ae9a39707430149 Mon Sep 17 00:00:00 2001 From: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com> Date: Wed, 12 Jan 2022 01:56:08 +0530 Subject: [PATCH] Ignore utf-8 decode error during logging (#966) --- proxy/http/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/http/handler.py b/proxy/http/handler.py index 8193255c..73e189a0 100644 --- a/proxy/http/handler.py +++ b/proxy/http/handler.py @@ -307,7 +307,7 @@ class HttpProtocolHandler(BaseTcpServerHandler): except Exception as exc: logger.exception('Error parsing the request', exc_info=exc) raise HttpProtocolException( - 'Error when parsing request: %s' % data.tobytes().decode('utf-8'), + 'Error when parsing request: %s' % data.tobytes().decode('utf-8', errors='ignore'), ) if not self.request.is_complete: return False