respect request charset

Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
This commit is contained in:
Steve Romanow 2011-05-18 18:16:48 -04:00 committed by Armin Ronacher
parent 017117778e
commit 41952d2b25

View file

@ -73,7 +73,13 @@ class Request(RequestBase):
if __debug__:
_assert_have_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):