From 51853a22bc2ee3651ca66c8f435b9845c57ff3c5 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 6 May 2011 15:02:29 +0200 Subject: [PATCH] Manage empty strings for CONTENT_LENGTH header --- radicale/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index a7e263f0..31038e90 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.get("CONTENT_LENGTH", 0)) + content_length = int(environ.get("CONTENT_LENGTH") or 0) if content_length: content = self.decode( environ["wsgi.input"].read(content_length), environ)