From b23ba58cd65b8aa9cc832e579602c715dd1aee74 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:16:34 +0545 Subject: [PATCH] tests: daemon: log body of the request (#10039) log body of the request --- tests/func/test_daemon.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/func/test_daemon.py b/tests/func/test_daemon.py index c6d678ace..f8485b6d2 100644 --- a/tests/func/test_daemon.py +++ b/tests/func/test_daemon.py @@ -44,6 +44,12 @@ def make_request_handler(): # save requests count for each method hits: Dict[str, int] = defaultdict(int) + def log_message(self, format, *args) -> None: # noqa: A002 + super().log_message(format, *args) + if length := self.headers.get("Content-Length"): + data = self.rfile.read(int(length)).decode("utf8") + sys.stderr.write(f"{data}\n") + def do_POST(self): # noqa: N802 # analytics endpoint self.hits["POST"] += 1