diff --git a/scripts/api.js b/scripts/api.js index 3d8bf559b2..5bcae78a77 100644 --- a/scripts/api.js +++ b/scripts/api.js @@ -53,10 +53,12 @@ request.write(""); request.write("

"); if ((command = request.getHeader("command"))) { - cmd_list = command.split(" ", 2); + cmd_list = command.split(" "); + cmd = cmd_list.shift(); + args = cmd_list.join(" "); - if ((reply = apiExecute(cmd_list[0], cmd_list[1]))) { - request.write("Command Result
" + reply + "\n
"); + if ((reply = apiExecute(cmd, args))) { + request.write("
Command Result
" + reply + "\n
"); } }