Mercurial > prosody-modules
comparison mod_rest/mod_rest.lua @ 3864:d845475c75f3
mod_rest: Process results even on internal errors with HTTP request
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 25 Jan 2020 20:12:50 +0100 |
| parents | 3b6b8dcff78e |
| children | a44e20cbd986 |
comparison
equal
deleted
inserted
replaced
| 3863:45b04f05d624 | 3864:d845475c75f3 |
|---|---|
| 221 ["Content-Language"] = stanza.attr["xml:lang"], | 221 ["Content-Language"] = stanza.attr["xml:lang"], |
| 222 Accept = table.concat(supported_types, ", "); | 222 Accept = table.concat(supported_types, ", "); |
| 223 }, | 223 }, |
| 224 }, function (body, code, response) | 224 }, function (body, code, response) |
| 225 if code == 0 then | 225 if code == 0 then |
| 226 return module:log_status("error", "Could not connect to callback URL %q: %s", rest_url, body); | 226 module:log_status("error", "Could not connect to callback URL %q: %s", rest_url, body); |
| 227 else | 227 else |
| 228 module:set_status("info", "Connected"); | 228 module:set_status("info", "Connected"); |
| 229 end | 229 end |
| 230 if (code == 202 or code == 204) and not reply_needed then | 230 if (code == 202 or code == 204) and not reply_needed then |
| 231 -- Delivered, no reply | 231 -- Delivered, no reply |
