Mercurial > prosody-modules
comparison mod_rest/mod_rest.lua @ 5650:0eb2d5ea2428
merge
| author | Stephen Paul Weber <singpolyma@singpolyma.net> |
|---|---|
| date | Sat, 06 May 2023 19:40:23 -0500 |
| parents | 3c51eab0afe8 |
| children | d7667d9ad96a |
comparison
equal
deleted
inserted
replaced
| 5649:2c69577b28c2 | 5650:0eb2d5ea2428 |
|---|---|
| 388 end | 388 end |
| 389 end | 389 end |
| 390 module:hook(archive_event_name, archive_handler, 1); | 390 module:hook(archive_event_name, archive_handler, 1); |
| 391 end | 391 end |
| 392 | 392 |
| 393 local p = module:send_iq(payload, origin):next( | 393 local iq_timeout = tonumber(request.headers.prosody_rest_timeout) or module:get_option_number("rest_iq_timeout", 60*2); |
| 394 iq_timeout = math.min(iq_timeout, module:get_option_number("rest_iq_max_timeout", 300)); | |
| 395 | |
| 396 local p = module:send_iq(payload, origin, iq_timeout):next( | |
| 394 function (result) | 397 function (result) |
| 395 module:log("debug", "Sending[rest]: %s", result.stanza:top_tag()); | 398 module:log("debug", "Sending[rest]: %s", result.stanza:top_tag()); |
| 396 response.headers.content_type = send_type; | 399 response.headers.content_type = send_type; |
| 397 if responses[1] then | 400 if responses[1] then |
| 398 local tail = responses[#responses]; | 401 local tail = responses[#responses]; |
