Просмотр исходного кода

Remove environment variables from logs only if they are in the requests

Guillaume Ayoub 14 лет назад
Родитель
Сommit
58cdbf7450
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      radicale/__init__.py

+ 2 - 1
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