def __call__(self, value):
if _is_guillotina_response(value):
body = value.response
if not isinstance(body, bytes):
if not isinstance(body, str):
body = ujson.dumps(value.response)
body = body.encode('utf8')
value = aioResponse(
body=body, status=value.status,
headers=value.headers)
if 'content-type' not in value.headers:
value.headers.update({
'content-type': self.content_type
})
return value
评论列表
文章目录