Add a way to minify REST API responses in modules/rest_api.py
This commit is contained in:
parent
d72e01aa68
commit
8024bc9c80
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue