mod_rest: Include full_jid property on origin
authorKim Alvefur <zash@zash.se>
Sun, 18 Jun 2023 22:23:24 +0200
changeset 5561 d7667d9ad96a
parent 5560 dfade0e38930
child 5562 3276750332ea
mod_rest: Include full_jid property on origin Fixes permission check in disco#info query to your own account, where the 'to' would have been stripped since it equals the account JID, leaving mod_disco passing nil, which triggers an error in module:may()
mod_rest/mod_rest.lua
--- a/mod_rest/mod_rest.lua	Sun Jun 18 15:28:23 2023 +0200
+++ b/mod_rest/mod_rest.lua	Sun Jun 18 22:23:24 2023 +0200
@@ -308,6 +308,7 @@
 			return post_errors.new("unauthz");
 		end
 		from = jid.join(origin.username, origin.host, origin.resource);
+		origin.full_jid = from;
 		origin.type = "c2s";
 		origin.log = module._log;
 	end