diff options
author | yo <johan@nosd.in> | 2022-11-13 16:24:53 +0100 |
---|---|---|
committer | yo <johan@nosd.in> | 2022-11-13 16:24:53 +0100 |
commit | 86d99407f4980a25112a3d6b40cae3419a677ea1 (patch) | |
tree | b5dc6a7b51d927d0603ea29ae45b94e50a3642a6 /src/plugins | |
parent | 0d89d51e9f280b36554e8f9bc66217e1d6f845c4 (diff) | |
download | rspamd-86d99407f4980a25112a3d6b40cae3419a677ea1.tar.gz rspamd-86d99407f4980a25112a3d6b40cae3419a677ea1.zip |
metadata_exporter http pusher: Extend valid return codes
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/metadata_exporter.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/lua/metadata_exporter.lua b/src/plugins/lua/metadata_exporter.lua index dceb81cd4..e011c56a9 100644 --- a/src/plugins/lua/metadata_exporter.lua +++ b/src/plugins/lua/metadata_exporter.lua @@ -300,15 +300,19 @@ local pushers = { end, http = function(task, formatted, rule) local function http_callback(err, code) + local valid_status = {200, 201, 202, 204} + if err then rspamd_logger.errx(task, 'got error %s in http callback', err) return maybe_defer(task, rule) end - if code ~= 200 then - rspamd_logger.errx(task, 'got unexpected http status: %s', code) - return maybe_defer(task, rule) + for i, v in ipairs(valid_status) do + if v == code then + return true + end end - return true + rspamd_logger.errx(task, 'got unexpected http status: %s', code) + return maybe_defer(task, rule) end local hdrs = {} if rule.meta_headers then |