mod_rest: Verify that @xmlns is left empty
Prosody needs it to be empty internally.
--- a/mod_rest/README.markdown Mon Dec 30 07:21:46 2019 +0100
+++ b/mod_rest/README.markdown Mon Dec 30 07:22:15 2019 +0100
@@ -109,6 +109,9 @@
The payload MUST contain one (1) `message`, `presence` or `iq` stanza.
+The stanzas MUST NOT have an `xmlns` attribute, and the default/empty
+namespace is treated as `jabber:client`.
+
# Compatibility
Requires Prosody trunk / 0.12
--- a/mod_rest/mod_rest.lua Mon Dec 30 07:21:46 2019 +0100
+++ b/mod_rest/mod_rest.lua Mon Dec 30 07:22:15 2019 +0100
@@ -24,6 +24,9 @@
-- parse fail
return errors.new({ code = 400, text = err });
end
+ if payload.attr.xmlns then
+ return errors.new({ code = 400, text = "'xmlns' attribute must be empty" });
+ end
local to = jid.prep(payload.attr.to);
if not to then
return errors.new({ code = 400, text = "Invalid destination JID" });