From 1e55d5a9d8a9d1de3102cdea68a13181edec1c37 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Mon, 6 Dec 2021 16:52:19 +0000 Subject: [PATCH] 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". --- hippolyzer/lib/proxy/http_event_manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hippolyzer/lib/proxy/http_event_manager.py b/hippolyzer/lib/proxy/http_event_manager.py index 32ca739..d8bc49c 100644 --- a/hippolyzer/lib/proxy/http_event_manager.py +++ b/hippolyzer/lib/proxy/http_event_manager.py @@ -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!