mod_admin_telnet: Use tostring as fallback in pretty printing
This has some nice effects such as functions, VirtualHosts and other
things being printed using their `__tostring` metamethod.
--- a/plugins/mod_admin_telnet.lua Sat May 02 20:39:33 2020 +0200
+++ b/plugins/mod_admin_telnet.lua Sat May 02 20:41:35 2020 +0200
@@ -335,6 +335,10 @@
if type(opts) ~= "table" then
opts = { preset = opts };
end
+ if not opts.fallback then
+ -- XXX Error message passed to fallback is lost, does it matter?
+ opts.fallback = tostring;
+ end
for k,v in pairs(serialize_defaults) do
if opts[k] == nil then
opts[k] = v;