From 7d655543f5d320c7bdd61b5a698481f7feb88555 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Sun, 5 Dec 2021 18:12:53 +0000 Subject: [PATCH] Dont reserialize responses as pretty LLSD-XML Certain LLSD parsers don't like the empty text nodes it adds around the root element of the document. Yuck. --- hippolyzer/lib/proxy/http_event_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hippolyzer/lib/proxy/http_event_manager.py b/hippolyzer/lib/proxy/http_event_manager.py index 33e0961..32ca739 100644 --- a/hippolyzer/lib/proxy/http_event_manager.py +++ b/hippolyzer/lib/proxy/http_event_manager.py @@ -280,7 +280,7 @@ class MITMProxyEventManager: # Send the client the URLs for any proxy-only caps it requested for cap_name in flow.metadata['needed_proxy_caps']: parsed[cap_name] = region.cap_urls[cap_name] - flow.response.content = llsd.format_pretty_xml(parsed) + flow.response.content = llsd.format_xml(parsed) elif cap_data.cap_name == "EventQueueGet": parsed_eq_resp = llsd.parse_xml(flow.response.content) if parsed_eq_resp: @@ -299,7 +299,7 @@ class MITMProxyEventManager: # HACK: see note in above request handler for EventQueueGet req_ack_id = llsd.parse_xml(flow.request.content)["ack"] eq_manager.cache_last_poll_response(req_ack_id, parsed_eq_resp) - flow.response.content = llsd.format_pretty_xml(parsed_eq_resp) + flow.response.content = llsd.format_xml(parsed_eq_resp) elif cap_data.cap_name in self.UPLOAD_CREATING_CAPS: if not region: return