Commit 4631b91e by Tom Christie

Fix broken 'binary content' in browseable API

parent d4721fc1
...@@ -332,8 +332,8 @@ class BrowsableAPIRenderer(BaseRenderer): ...@@ -332,8 +332,8 @@ class BrowsableAPIRenderer(BaseRenderer):
renderer_context['indent'] = 4 renderer_context['indent'] = 4
content = renderer.render(data, accepted_media_type, renderer_context) content = renderer.render(data, accepted_media_type, renderer_context)
if not isinstance(content, six.text_type): if not all(char in string.printable for char in content):
return '[%d bytes of binary content]' return '[%d bytes of binary content]' % len(content)
return content return content
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment