# HG changeset patch # User Kim Alvefur # Date 1577686935 -3600 # Node ID d59fb4dcf1008b34c4a1d1f80513c0efd1254896 # Parent cfa00eea896f37a02fc00e0e4031e0394fd39dea mod_rest: Verify that @xmlns is left empty Prosody needs it to be empty internally. diff -r cfa00eea896f -r d59fb4dcf100 mod_rest/README.markdown --- 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 diff -r cfa00eea896f -r d59fb4dcf100 mod_rest/mod_rest.lua --- 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" });