Comparison

mod_rest/mod_rest.lua @ 5557:d7667d9ad96a

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()
author Kim Alvefur <zash@zash.se>
date Sun, 18 Jun 2023 22:23:24 +0200
parent 5334:3c51eab0afe8
child 5585:5b316088bef5
comparison
equal deleted inserted replaced
5556:dfade0e38930 5557:d7667d9ad96a
306 origin = check_credentials(request); 306 origin = check_credentials(request);
307 if not origin then 307 if not origin then
308 return post_errors.new("unauthz"); 308 return post_errors.new("unauthz");
309 end 309 end
310 from = jid.join(origin.username, origin.host, origin.resource); 310 from = jid.join(origin.username, origin.host, origin.resource);
311 origin.full_jid = from;
311 origin.type = "c2s"; 312 origin.type = "c2s";
312 origin.log = module._log; 313 origin.log = module._log;
313 end 314 end
314 local payload, err = parse_request(request, path); 315 local payload, err = parse_request(request, path);
315 if not payload then 316 if not payload then