From 8bde7461c18460e4fbbc87be6d0853d2a645d5ba Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 6 Sep 2021 23:21:25 +0200 Subject: mod_c2s,mod_s2s: Indicate stanza size violation with condition from XEP-0205 (thanks mjk) --- plugins/mod_c2s.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/mod_c2s.lua') diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 8bd28782..1f22d871 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -339,7 +339,11 @@ function listener.onconnect(conn) if not ok then log("debug", "Received invalid XML (%s) %d bytes: %q", err, #data, data:sub(1, 300)); if err == "stanza-too-large" then - session:close({ condition = "policy-violation", text = "XML stanza is too big" }); + session:close({ + condition = "policy-violation", + text = "XML stanza is too big", + extra = st.stanza("stanza-too-big", { xmlns = 'urn:xmpp:errors' }), + }); else session:close("not-well-formed"); end -- cgit v1.2.3