Msgpack handling: fix compatibilty with newer fastapi.

Fixes #112.
Supersedes #127.
master
Tom Hacohen 2022-03-25 15:17:34 +03:00
parent 247c5ea680
commit f62d4ebdfc
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ from .db_hack import django_db_cleanup_decorator
class MsgpackRequest(Request):
media_type = "application/msgpack"
async def json(self) -> bytes:
async def body(self) -> bytes:
if not hasattr(self, "_json"):
body = await super().body()
self._json = msgpack_decode(body)