From 58cdbf7450885a6e78aa2259a656f229cd82175c Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 29 Jul 2011 10:38:33 +0200 Subject: [PATCH] Remove environment variables from logs only if they are in the requests --- radicale/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 1b75a9f..2dd1975 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -113,7 +113,8 @@ class Application(object): """Remove environment variables from the headers for logging.""" request_environ = dict(environ) for shell_variable in os.environ: - del request_environ[shell_variable] + if shell_variable in request_environ: + del request_environ[shell_variable] return request_environ # pylint: enable=E0202