mod_s2s: Only nameprep stream to/from addresses if they are present
Prevents traceback from nameprep(nil)
--- a/plugins/mod_s2s/mod_s2s.lua Sat Nov 02 15:40:20 2019 +0100
+++ b/plugins/mod_s2s/mod_s2s.lua Sat Nov 02 15:43:17 2019 +0100
@@ -327,7 +327,9 @@
-- Send a reply stream header
-- Validate to/from
- local to, from = nameprep(attr.to), nameprep(attr.from);
+ local to, from = attr.to, attr.from;
+ if to then to = nameprep(attr.to); end
+ if from then from = nameprep(attr.from); end
if not to and attr.to then -- COMPAT: Some servers do not reliably set 'to' (especially on stream restarts)
session:close({ condition = "improper-addressing", text = "Invalid 'to' address" });
return;