Mercurial > prosody-modules
comparison mod_rest/mod_rest.lua @ 3801:d59fb4dcf100
mod_rest: Verify that @xmlns is left empty
Prosody needs it to be empty internally.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 30 Dec 2019 07:22:15 +0100 |
parents | a1f1f703d604 |
children | f88e07630e4e |
comparison
equal
deleted
inserted
replaced
3800:cfa00eea896f | 3801:d59fb4dcf100 |
---|---|
21 end | 21 end |
22 local payload, err = xml.parse(request.body); | 22 local payload, err = xml.parse(request.body); |
23 if not payload then | 23 if not payload then |
24 -- parse fail | 24 -- parse fail |
25 return errors.new({ code = 400, text = err }); | 25 return errors.new({ code = 400, text = err }); |
26 end | |
27 if payload.attr.xmlns then | |
28 return errors.new({ code = 400, text = "'xmlns' attribute must be empty" }); | |
26 end | 29 end |
27 local to = jid.prep(payload.attr.to); | 30 local to = jid.prep(payload.attr.to); |
28 if not to then | 31 if not to then |
29 return errors.new({ code = 400, text = "Invalid destination JID" }); | 32 return errors.new({ code = 400, text = "Invalid destination JID" }); |
30 end | 33 end |