def __call__(self, value):
# Safe html transformation
if _is_pserver_response(value):
body = value.response
if not isinstance(body, bytes):
if not isinstance(body, str):
body = json.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': 'text/html'
})
return value
评论列表
文章目录