Merge pull request #224 from deronnax/decode_content_later
decode http resquest content later
This commit is contained in:
commit
124cf3f51a
@ -261,15 +261,6 @@ class Application(object):
|
|||||||
"Path not starting with prefix: %s", environ["PATH_INFO"])
|
"Path not starting with prefix: %s", environ["PATH_INFO"])
|
||||||
environ["PATH_INFO"] = None
|
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"]
|
path = environ["PATH_INFO"]
|
||||||
|
|
||||||
# Get function corresponding to method
|
# Get function corresponding to method
|
||||||
@ -297,6 +288,15 @@ class Application(object):
|
|||||||
else:
|
else:
|
||||||
read_allowed_items, write_allowed_items = None, None
|
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 (
|
if is_valid_user and (
|
||||||
(read_allowed_items or write_allowed_items) or
|
(read_allowed_items or write_allowed_items) or
|
||||||
(is_authenticated and function == self.propfind) or
|
(is_authenticated and function == self.propfind) or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user