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,6 +38,10 @@ class Handler(http.server.BaseHTTPRequestHandler):
code = 500 code = 500
if not event_response == None: if not event_response == None:
if _bot.get_setting("api-minify", False):
resonse = json.dumps(event_response, sort_keys=True
separators=(",", ":"))
else:
response = json.dumps(event_response, response = json.dumps(event_response,
sort_keys=True, indent=4) sort_keys=True, indent=4)
code = 200 code = 200