libs/web: transparently handle userdata in write_json()
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 15 Sep 2012 14:25:18 +0000 (14:25 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 15 Sep 2012 14:25:18 +0000 (14:25 +0000)
libs/web/luasrc/http.lua

index 60a3e07..1811250 100644 (file)
@@ -339,7 +339,7 @@ function write_json(x)
                else
                        write(tostring(x))
                end
-       elseif type(x) == "string" then
+       else
                write("%q" % tostring(x))
        end
 end