From c590443de3d30dd0e5e0f76183336cedcebcaa0a Mon Sep 17 00:00:00 2001 From: dtookey Date: Tue, 20 Apr 2021 21:56:11 -0400 Subject: [PATCH] fixed json reply bug --- standalone_command.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/standalone_command.py b/standalone_command.py index edbe488..05b195f 100644 --- a/standalone_command.py +++ b/standalone_command.py @@ -22,7 +22,7 @@ def handle_command(command, rest): if command == "!echo": message = "Got payload [%s]" % rest print(message) - return flask.make_response("{message:\"%s\"}" % message, 200, {"Content-Type": "application/json"}) + return flask.make_response("{\"message\":\"%s\"}" % message, 200, {"Content-Type": "application/json"}) @api.route('/api/v1/command', methods=['GET']) @@ -37,9 +37,9 @@ def command_check(): @api.route('/api/v1/exec', methods=['GET']) def exec_command(): if 'command_name' not in request.args: - return flask.make_response('{text:"Argument \'command_name\' not in request"}', 400) + return flask.make_response('{\"text\":"Argument \'command_name\' not in request"}', 400) if 'rest' not in request.args: - return flask.make_response('{text:"Argument \'rest\' not in request"}', 400) + return flask.make_response('{\"text\":"Argument \'rest\' not in request"}', 400) return handle_command(request.args['command_name'], request.args['rest'])