Mercurial > prosody-modules
comparison mod_rest/mod_rest.lua @ 4955:537054999093
mod_rest: Provide a log function on temporary session
Fixes traceback in places using session.log()
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 29 May 2022 02:02:07 +0200 |
parents | e67cc71727ca |
children | 732229fe68ab |
comparison
equal
deleted
inserted
replaced
4954:e8a487c42b36 | 4955:537054999093 |
---|---|
303 if not origin then | 303 if not origin then |
304 return post_errors.new("unauthz"); | 304 return post_errors.new("unauthz"); |
305 end | 305 end |
306 from = jid.join(origin.username, origin.host, origin.resource); | 306 from = jid.join(origin.username, origin.host, origin.resource); |
307 origin.type = "c2s"; | 307 origin.type = "c2s"; |
308 origin.log = module._log; | |
308 end | 309 end |
309 local payload, err = parse_request(request, path); | 310 local payload, err = parse_request(request, path); |
310 if not payload then | 311 if not payload then |
311 -- parse fail | 312 -- parse fail |
312 local ctx = { error = err, type = request.headers.content_type, data = request.body, }; | 313 local ctx = { error = err, type = request.headers.content_type, data = request.body, }; |