Diff

plugins/mod_s2s.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 11742:9c450185bac1
child 11772:e2155e2703dd
line wrap: on
line diff
--- a/plugins/mod_s2s.lua	Sun Sep 05 18:42:44 2021 +0200
+++ b/plugins/mod_s2s.lua	Mon Sep 06 23:21:25 2021 +0200
@@ -746,7 +746,11 @@
 			if ok then return; end
 			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" }, nil, "Received invalid XML from remote server");
+				session:close({
+					condition = "policy-violation",
+					text = "XML stanza is too big",
+					extra = st.stanza("stanza-too-big", { xmlns = 'urn:xmpp:errors' }),
+				}, nil, "Received invalid XML from remote server");
 			else
 				session:close("not-well-formed", nil, "Received invalid XML from remote server");
 			end