From: Jo-Philipp Wich Date: Thu, 12 Jul 2018 16:55:16 +0000 (+0200) Subject: luci-mod-admin-full: produce valid JSON in status/realtime/connections_status X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b7bf164feae617c840c5f43006de1fd62baba91e;p=oweals%2Fluci.git luci-mod-admin-full: produce valid JSON in status/realtime/connections_status Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua index 4471fd597..ff95f3d91 100644 --- a/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua +++ b/modules/luci-mod-admin-full/luasrc/controller/admin/status.lua @@ -122,12 +122,12 @@ function action_connections() luci.http.prepare_content("application/json") - luci.http.write("{ connections: ") + luci.http.write('{ "connections": ') luci.http.write_json(sys.net.conntrack()) local bwc = io.popen("luci-bwc -c 2>/dev/null") if bwc then - luci.http.write(", statistics: [") + luci.http.write(', "statistics": [') while true do local ln = bwc:read("*l")