|
|
@ -18,10 +18,10 @@ from .globals import _request_ctx_stack |
|
|
|
_missing = object() |
|
|
|
_missing = object() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _get_data(req, cache): |
|
|
|
def _get_data(req): |
|
|
|
getter = getattr(req, 'get_data', None) |
|
|
|
getter = getattr(req, 'get_data', None) |
|
|
|
if getter is not None: |
|
|
|
if getter is not None: |
|
|
|
return getter(cache=cache) |
|
|
|
return getter() |
|
|
|
return req.data |
|
|
|
return req.data |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -84,7 +84,7 @@ class JSONMixin(object): |
|
|
|
# been encoded correctly as well. |
|
|
|
# been encoded correctly as well. |
|
|
|
charset = self.mimetype_params.get('charset') |
|
|
|
charset = self.mimetype_params.get('charset') |
|
|
|
try: |
|
|
|
try: |
|
|
|
data = _get_data(self, cache) |
|
|
|
data = _get_data(self) |
|
|
|
if charset is not None: |
|
|
|
if charset is not None: |
|
|
|
rv = json.loads(data, encoding=charset) |
|
|
|
rv = json.loads(data, encoding=charset) |
|
|
|
else: |
|
|
|
else: |
|
|
|