Software /
code /
prosody
Diff
plugins/mod_s2s/mod_s2s.lua @ 10381:66fa45d24481
mod_s2s: Only nameprep stream to/from addresses if they are present
Prevents traceback from nameprep(nil)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 Nov 2019 15:43:17 +0100 |
parent | 10311:1bb1e16f24b0 |
child | 10403:3b82e9df5a7a |
line wrap: on
line diff
--- 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;