Browse Source

respect request charset

Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
pull/232/merge
Steve Romanow 14 years ago committed by Armin Ronacher
parent
commit
41952d2b25
  1. 8
      flask/wrappers.py

8
flask/wrappers.py

@ -73,7 +73,13 @@ class Request(RequestBase):
if __debug__: if __debug__:
_assert_have_json() _assert_have_json()
if self.mimetype == 'application/json': if self.mimetype == 'application/json':
return json.loads(self.data) request_charset = self.mimetype_params.get('charset')
if request_charset is not None:
j = json.loads(self.data, encoding=request_charset )
else:
j = json.loads(self.data)
return j
class Response(ResponseBase): class Response(ResponseBase):

Loading…
Cancel
Save