From 34ca7d54be9dd3c6cfce9e38222bb31114ead977 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Thu, 18 Aug 2022 14:40:33 +0000 Subject: [PATCH] Support formatting SL's busted login endpoint responses --- hippolyzer/lib/proxy/message_logger.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hippolyzer/lib/proxy/message_logger.py b/hippolyzer/lib/proxy/message_logger.py index c1b944c..f4ec38c 100644 --- a/hippolyzer/lib/proxy/message_logger.py +++ b/hippolyzer/lib/proxy/message_logger.py @@ -549,6 +549,12 @@ class HTTPMessageLogEntry(AbstractMessageLogEntry): return self._summary def _guess_content_type(self, message): + # SL's login service lies and says that its XML-RPC response is LLSD+XML. + # It is not, and it blows up the parser. It's been broken ever since the + # login rewrite and a fix is likely not forthcoming. I'm sick of seeing + # the traceback, so just hack around it. + if self.name == "LoginRequest": + return "application/xml" content_type = message.headers.get("Content-Type", "") if not message.content or content_type.startswith("application/llsd"): return content_type