how to reproduce?
Just add this reply to any view:
return Response(status=status.HTTP_204_NO_CONTENT)
rest_framework/response.py
ret = renderer.render(self.data, accepted_media_type, context)
will return 'null', and it will end in a malformed http response.
It is not happening on rest_framework.renderers.JSONRenderer as it has:
def render(self, data, accepted_media_type=None, renderer_context=None):
"""
Render `data` into JSON, returning a bytestring.
"""
if data is None:
return b''