From 421189e2635264132ef5bae4fb6f34fd18e9eea3 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sun, 1 May 2011 19:08:15 +0200 Subject: [PATCH] Get CONTENT_LENGTH as it may be absent --- radicale/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 705bac11..12de69bd 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -129,7 +129,7 @@ class Application(object): log.LOGGER.debug("Request headers:\n%s" % environ.items()) # Get content - content_length = int(environ["CONTENT_LENGTH"] or 0) + content_length = int(environ.get("CONTENT_LENGTH", 0)) if content_length: content = self.decode( environ["wsgi.input"].read(content_length), environ)