Continue handling HTTP flows if flow logging fails

If flow beautification for display throws then we don't want
to bypass other handling of the flow.

This fixes a login failure due to SL's login XML-RPC endpoint
returning a Content-Type of "application/llsd+xml/r/n" when it's
actually "application/xml".
This commit is contained in:
Salad Dais
2021-12-06 16:52:19 +00:00
parent 077a95b5e7
commit 1e55d5a9d8

View File

@@ -212,7 +212,10 @@ class MITMProxyEventManager:
def _handle_response(self, flow: HippoHTTPFlow):
message_logger = self.session_manager.message_logger
if message_logger:
message_logger.log_http_response(flow)
try:
message_logger.log_http_response(flow)
except:
logging.exception("Failed while logging HTTP flow")
# Don't process responses for requests or responses injected by the proxy.
# We already processed it, it came from us!