summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-06-28 15:44:38 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-06-28 20:23:39 +0200
commitdbce3e4582483af01f55cb2ddca26fb09dbf853a (patch)
treea8f2745b5afa3f13ec49695b630cc55cd2e24ec8 /module
parent[Lib] Removed unused Unzip.py (diff)
downloadpyload-dbce3e4582483af01f55cb2ddca26fb09dbf853a.tar.xz
[Lib] Update bottle.py to version 0.12.7
Diffstat (limited to 'module')
-rw-r--r--module/lib/bottle.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/module/lib/bottle.py b/module/lib/bottle.py
index 0894d57c2..bcc284c1d 100644
--- a/module/lib/bottle.py
+++ b/module/lib/bottle.py
@@ -16,7 +16,7 @@ License: MIT (see LICENSE for details)
from __future__ import with_statement
__author__ = 'Marcel Hellkamp'
-__version__ = '0.12.5'
+__version__ = '0.12.7'
__license__ = 'MIT'
# The gevent server adapter needs to patch some modules before they are imported
@@ -1115,7 +1115,8 @@ class BaseRequest(object):
property holds the parsed content of the request body. Only requests
smaller than :attr:`MEMFILE_MAX` are processed to avoid memory
exhaustion. '''
- if 'application/json' in self.environ.get('CONTENT_TYPE', ''):
+ ctype = self.environ.get('CONTENT_TYPE', '').lower().split(';')[0]
+ if ctype == 'application/json':
return json_loads(self._get_body_string())
return None
@@ -1226,6 +1227,7 @@ class BaseRequest(object):
elif py3k:
args['encoding'] = 'utf8'
data = cgi.FieldStorage(**args)
+ self['_cgi.FieldStorage'] = data #http://bugs.python.org/issue18394#msg207958
data = data.list or []
for item in data:
if item.filename:
@@ -3340,7 +3342,10 @@ class SimpleTemplate(BaseTemplate):
@cached_property
def code(self):
- source = self.source or open(self.filename, 'rb').read()
+ source = self.source
+ if not source:
+ with open(self.filename, 'rb') as f:
+ source = f.read()
try:
source, encoding = touni(source), 'utf8'
except UnicodeError: