Software /
code /
prosody-modules
Changeset
4803:f74c7c518bb2
mod_rest: Handle unknown 'kind' values
Fixes error thrown by util.datamapper if the schema argument is nil
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 02 Dec 2021 16:08:40 +0100 |
parents | 4802:75543146e94e |
children | 4804:a7c0c70e64b6 |
files | mod_rest/jsonmap.lib.lua |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_rest/jsonmap.lib.lua Sun Nov 28 21:30:53 2021 +0100 +++ b/mod_rest/jsonmap.lib.lua Thu Dec 02 16:08:40 2021 +0100 @@ -499,6 +499,9 @@ elseif kind == "iq" and not t_type then t_type = "get"; end + if not schema.properties[kind or "message"] then + return nil, "unknown-kind"; + end -- XEP-0313 conveninece mapping if kind == "iq" and t_type == "set" and type(t.archive) == "table" and not t.archive.form then