mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 04:07:39 +03:00
Better checking if the content can be printable in the BrowsableAPI
This commit is contained in:
parent
97f034e3d6
commit
6dbbbc16da
|
@ -325,7 +325,7 @@ class BrowsableAPIRenderer(BaseRenderer):
|
|||
renderer_context['indent'] = 4
|
||||
content = renderer.render(data, accepted_media_type, renderer_context)
|
||||
|
||||
if not all(char in string.printable for char in content):
|
||||
if not isinstance(content, six.text_type):
|
||||
return '[%d bytes of binary content]'
|
||||
|
||||
return content
|
||||
|
|
Loading…
Reference in New Issue
Block a user