Diff

plugins/mod_c2s.lua @ 11770:d2a9aa1c7ac8

mod_c2s,mod_s2s: Indicate stanza size violation with condition from XEP-0205 (thanks mjk)
author Kim Alvefur <zash@zash.se>
date Mon, 06 Sep 2021 23:21:25 +0200
parent 11747:9f723b54e111
child 11778:f254fd16218a
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Sun Sep 05 18:42:44 2021 +0200
+++ b/plugins/mod_c2s.lua	Mon Sep 06 23:21:25 2021 +0200
@@ -339,7 +339,11 @@
 				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