changed None to return empty string instead of null string

This commit is contained in:
Arnulfo Solis
2018-02-01 11:52:55 +01:00
parent 8b23b5d389
commit 2135294e2e
3 changed files with 17 additions and 3 deletions

View File

@@ -239,7 +239,8 @@ def json(body, status=200, headers=None,
:param headers: Custom Headers.
:param kwargs: Remaining arguments that are passed to the json encoder.
"""
return HTTPResponse(dumps(body, **kwargs), headers=headers,
_body = dumps(body, **kwargs) if body else None
return HTTPResponse(_body, headers=headers,
status=status, content_type=content_type)