luci-mod-admin-full: produce valid JSON in status/realtime/connections_status
authorJo-Philipp Wich <jo@mein.io>
Thu, 12 Jul 2018 16:55:16 +0000 (18:55 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 12 Jul 2018 16:55:16 +0000 (18:55 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-admin-full/luasrc/controller/admin/status.lua

index 4471fd597a1be0f39402d5b62248464cb9faeede..ff95f3d9150e055d88fc7c17f9d9f5b5b4d6f571 100644 (file)
@@ -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")