From c180b4ace3ecf7d17b9e83c8960cbba055e1d32e Mon Sep 17 00:00:00 2001 From: deronnax Date: Fri, 17 Oct 2014 17:45:16 +0200 Subject: [PATCH] decode http resquest content later --- radicale/__init__.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 2824efd..9067631 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -261,15 +261,6 @@ class Application(object): "Path not starting with prefix: %s", environ["PATH_INFO"]) environ["PATH_INFO"] = None - # Get content - content_length = int(environ.get("CONTENT_LENGTH") or 0) - if content_length: - content = self.decode( - environ["wsgi.input"].read(content_length), environ) - log.LOGGER.debug("Request content:\n%s" % content) - else: - content = None - path = environ["PATH_INFO"] # Get function corresponding to method @@ -297,6 +288,15 @@ class Application(object): else: read_allowed_items, write_allowed_items = None, None + # Get content + content_length = int(environ.get("CONTENT_LENGTH") or 0) + if content_length: + content = self.decode( + environ["wsgi.input"].read(content_length), environ) + log.LOGGER.debug("Request content:\n%s" % content) + else: + content = None + if is_valid_user and ( (read_allowed_items or write_allowed_items) or (is_authenticated and function == self.propfind) or