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 60a3e0722808dd146c8bbe9306f659dc366925a0..18112507ce3565b6e7643ab8060fa61636282203 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