From 5f14a92633104aaf6cf399b5c2b52edbaf157791 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 25 Apr 2011 19:36:19 +0200 Subject: [PATCH] Print request headers and not response headers --- radicale/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 42f32f5..641fba5 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -94,15 +94,16 @@ def _log_request_content(request, function): content_length = int(request.headers.get("Content-Length", 0)) if content_length: request._content = request.rfile.read(content_length) + log.LOGGER.debug( + "Request headers:\n%s" % "\n".join( + ": ".join((key, value)) + for key, value in request.headers.items())) log.LOGGER.debug("Request content:\n%s" % request._content) else: request._content = None function(request) - log.LOGGER.debug( - "Response headers:\n%s" % "\n".join( - ": ".join((key, value)) for key, value in request.headers.items())) if getattr(request, "_answer"): log.LOGGER.debug( "Response content:\n%s" % request._answer)