mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
JSONResponse.body is UTF-8 bytes and must be decoded
This commit is contained in:
@@ -54,7 +54,7 @@ class JsonCoder(Coder):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def encode(cls, value: Any) -> str:
|
def encode(cls, value: Any) -> str:
|
||||||
if isinstance(value, JSONResponse):
|
if isinstance(value, JSONResponse):
|
||||||
return value.body
|
return value.body.decode()
|
||||||
return json.dumps(value, cls=JsonEncoder)
|
return json.dumps(value, cls=JsonEncoder)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user