changeset 3806:c0caee8f54bb

mod_rest: Ensure identical id attribute for error replies
author Kim Alvefur <zash@zash.se>
date Wed, 01 Jan 2020 10:59:04 +0100
parents 683b06c0348f
children b0449faca52b
files mod_rest/mod_rest.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/mod_rest.lua	Wed Jan 01 07:59:18 2020 +0100
+++ b/mod_rest/mod_rest.lua	Wed Jan 01 10:59:04 2020 +0100
@@ -176,7 +176,7 @@
 						module:log("warn", "REST callback responded with the wrong stanza type, got %s but expected %s", parsed.name, stanza.name);
 					else
 						parsed.attr.to, parsed.attr.from = stanza.attr.from, stanza.attr.to;
-						if parsed.name == "iq" then
+						if parsed.name == "iq" or parsed.attr.type == "error" then
 							parsed.attr.id = stanza.attr.id;
 						end
 						reply = parsed;