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,8 +38,12 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
||||||
code = 500
|
code = 500
|
||||||
|
|
||||||
if not event_response == None:
|
if not event_response == None:
|
||||||
response = json.dumps(event_response,
|
if _bot.get_setting("api-minify", False):
|
||||||
sort_keys=True, indent=4)
|
resonse = json.dumps(event_response, sort_keys=True
|
||||||
|
separators=(",", ":"))
|
||||||
|
else:
|
||||||
|
response = json.dumps(event_response,
|
||||||
|
sort_keys=True, indent=4)
|
||||||
code = 200
|
code = 200
|
||||||
else:
|
else:
|
||||||
code = 401
|
code = 401
|
||||||
|
|
Loading…
Reference in a new issue