Ignore utf-8 decode error during logging (#966)

This commit is contained in:
Abhinav Singh 2022-01-12 01:56:08 +05:30 committed by GitHub
parent a84ababb94
commit 7199459c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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