diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-02-01 13:25:11 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-02-01 13:25:11 +0000 |
commit | e509f85e28176a8b8ba9a5c684c8ecc0731f9657 (patch) | |
tree | ed240bb9da2d6bf8e1587938791dc39213982fd3 /lualib | |
parent | fda5af53e80823080fd5228924f1665ec9636bad (diff) | |
download | rspamd-e509f85e28176a8b8ba9a5c684c8ecc0731f9657.tar.gz rspamd-e509f85e28176a8b8ba9a5c684c8ecc0731f9657.zip |
[Minor] Support keepalive and authorization
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_scanners/kaspersky_se.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lualib/lua_scanners/kaspersky_se.lua b/lualib/lua_scanners/kaspersky_se.lua index ec9589ac6..10a3e0f47 100644 --- a/lualib/lua_scanners/kaspersky_se.lua +++ b/lualib/lua_scanners/kaspersky_se.lua @@ -48,6 +48,8 @@ local function kaspersky_se_config(opts) scan_mime_parts = true, scan_text_mime = false, scan_image_mime = false, + keepalive = true, + auth_string = nil } default_conf = lua_util.override_defaults(default_conf, opts) @@ -123,6 +125,10 @@ local function kaspersky_se_check(task, content, digest, rule, maybe_part) hdrs['X-KAV-HostIP'] = tostring(ip) end + if rule.auth_string then + hdrs['Authorization'] = rule.auth_string + end + if task:has_from() then hdrs['X-KAV-ObjectURL'] = string.format('[from:%s]', task:get_from()[1].addr) end @@ -163,6 +169,7 @@ local function kaspersky_se_check(task, content, digest, rule, maybe_part) body = req_body, headers = hdrs, timeout = rule.timeout, + keepalive = rule.keepalive, } local function kas_callback(http_err, code, body, headers) |