From aae4afe7b885cc585f031e42500d9d772f616353 Mon Sep 17 00:00:00 2001 From: Midorica Date: Sun, 25 Jun 2023 11:59:17 -0400 Subject: [PATCH] Adding debug logging to SAO --- titles/sao/index.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/titles/sao/index.py b/titles/sao/index.py index b74e500..69a3db5 100644 --- a/titles/sao/index.py +++ b/titles/sao/index.py @@ -97,20 +97,20 @@ class SaoServlet(resource.Resource): req_url = request.uri.decode() if req_url == "/matching": self.logger.info("Matching request") - + request.responseHeaders.addRawHeader(b"content-type", b"text/html; charset=utf-8") sao_request = request.content.getvalue().hex() - #sao_request = sao_request[:32] handler = getattr(self.base, f"handle_{sao_request[:4]}", None) if handler is None: self.logger.info(f"Generic Handler for {req_url} - {sao_request[:4]}") - #self.logger.debug(f"Request: {request.content.getvalue().hex()}") + self.logger.debug(f"Request: {request.content.getvalue().hex()}") resp = SaoNoopResponse(int.from_bytes(bytes.fromhex(sao_request[:4]), "big")+1) self.logger.debug(f"Response: {resp.make().hex()}") return resp.make() self.logger.info(f"Handler {req_url} - {sao_request[:4]} request") self.logger.debug(f"Request: {request.content.getvalue().hex()}") + self.logger.debug(f"Response: {handler(sao_request).hex()}") return handler(sao_request) \ No newline at end of file