소스 검색

Merge pull request #224 from deronnax/decode_content_later

decode http resquest content later
Guillaume Ayoub 11 년 전
부모
커밋
124cf3f51a
1개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 9 9
      radicale/__init__.py

+ 9 - 9
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