Add a way to minify REST API responses in modules/rest_api.py

This commit is contained in:
jesopo 2018-11-11 08:51:50 +00:00
parent d72e01aa68
commit 8024bc9c80

View file

@ -38,8 +38,12 @@ class Handler(http.server.BaseHTTPRequestHandler):
code = 500
if not event_response == None:
response = json.dumps(event_response,
sort_keys=True, indent=4)
if _bot.get_setting("api-minify", False):
resonse = json.dumps(event_response, sort_keys=True
separators=(",", ":"))
else:
response = json.dumps(event_response,
sort_keys=True, indent=4)
code = 200
else:
code = 401