changeset 3818:a607c69d0804

mod_rest: Guess 'get' as default type for 'iq' stanzas in JSON mapping
author Kim Alvefur <zash@zash.se>
date Wed, 01 Jan 2020 17:37:04 +0100
parents 937f8c463be6
children 1bab6f67eb5f
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	Wed Jan 01 17:16:40 2020 +0100
+++ b/mod_rest/jsonmap.lib.lua	Wed Jan 01 17:37:04 2020 +0100
@@ -225,6 +225,9 @@
 	if t.from and not s.attr.from then
 		return nil, "invalid-jid-from";
 	end
+	if kind == "iq" and not t.type then
+		t.type = "get";
+	end
 
 	if type(t.error) == "table" then
 		return st.error_reply(st.reply(s), str(t.error.type), str(t.error.condition), str(t.error.text));