libs/web: transparently handle userdata in write_json()
[project/luci.git] / libs / web / luasrc / http.lua
index 60a3e0722808dd146c8bbe9306f659dc366925a0..18112507ce3565b6e7643ab8060fa61636282203 100644 (file)
@@ -339,7 +339,7 @@ function write_json(x)
                else
                        write(tostring(x))
                end
                else
                        write(tostring(x))
                end
-       elseif type(x) == "string" then
+       else
                write("%q" % tostring(x))
        end
 end
                write("%q" % tostring(x))
        end
 end