diff options
Diffstat (limited to 'src/plugins/lua/metadata_exporter.lua')
-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 |