From f52fa73cab6d8d225e588e08925be0edcc9abd8f Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Mon, 19 Sep 2016 20:04:11 +0200 Subject: [PATCH] check env first before using HTTP_DEPTH --- radicale/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 798c512..87ec4c8 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -316,8 +316,9 @@ class Application: if environ["HTTP_USER_AGENT"]: remote_useragent = environ["HTTP_USER_AGENT"] depthinfo = "" - if environ["HTTP_DEPTH"]: - depthinfo = " with depth " + environ["HTTP_DEPTH"] + if "HTTP_DEPTH" in environ: + if environ["HTTP_DEPTH"]: + depthinfo = " with depth " + environ["HTTP_DEPTH"] time_begin = datetime.datetime.now() self.logger.info("%s request for %s received from %s using \"%s\"", environ["REQUEST_METHOD"], environ["PATH_INFO"] + depthinfo, remote_host, remote_useragent)