mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 05:04:31 +03:00
Fix broken 'binary content' in browseable API
This commit is contained in:
parent
d4721fc1f7
commit
4631b91e14
|
@ -332,8 +332,8 @@ class BrowsableAPIRenderer(BaseRenderer):
|
|||
renderer_context['indent'] = 4
|
||||
content = renderer.render(data, accepted_media_type, renderer_context)
|
||||
|
||||
if not isinstance(content, six.text_type):
|
||||
return '[%d bytes of binary content]'
|
||||
if not all(char in string.printable for char in content):
|
||||
return '[%d bytes of binary content]' % len(content)
|
||||
|
||||
return content
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user