Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
better logic for html renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
vangheem committed Feb 24, 2017
1 parent 3c8ae42 commit d057440
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/plone.server/plone/server/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,13 @@ async def __call__(self, value):
# Safe html transformation
if _is_pserver_response(value):
body = value.response
if not isinstance(body, str):
body = json.dumps(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.encode('utf8'), status=value.status,
body=body, status=value.status,
headers=value.headers)
value.headers.update({
'content-type': 'text/html'
Expand Down

0 comments on commit d057440

Please sign in to comment.