Browse Source

implement log of response header

Peter Bieringer 2 months ago
parent
commit
2b2c417b1b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      radicale/app/__init__.py

+ 5 - 0
radicale/app/__init__.py

@@ -262,6 +262,11 @@ class Application(ApplicationPartDelete, ApplicationPartHead,
             # Add extra headers set in configuration
             headers.update(self._extra_headers)
 
+            if self._response_header_on_debug:
+                logger.debug("Response header:\n%s", utils.textwrap_str(pprint.pformat(headers)))
+            else:
+                logger.debug("Response header: suppressed by config/option [logging] response_header_on_debug")
+
             # Start response
             time_end = datetime.datetime.now()
             time_delta_seconds = (time_end - time_begin).total_seconds()