aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_mime.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-10-22 13:17:45 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-10-22 13:17:45 +0100
commit272503b1ba88fe9802192ef65a1f7674e0a51f2b (patch)
tree33f7632832cf720acf1a805389239646b3cb8eea /lualib/lua_mime.lua
parentded2e51e60325a0e817362c6df0c341bb00d4b0e (diff)
downloadrspamd-272503b1ba88fe9802192ef65a1f7674e0a51f2b.tar.gz
rspamd-272503b1ba88fe9802192ef65a1f7674e0a51f2b.zip
[Minor] Fix corner cases
Diffstat (limited to 'lualib/lua_mime.lua')
-rw-r--r--lualib/lua_mime.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/lualib/lua_mime.lua b/lualib/lua_mime.lua
index 9dff5cfed..038dccceb 100644
--- a/lualib/lua_mime.lua
+++ b/lualib/lua_mime.lua
@@ -590,8 +590,8 @@ exports.modify_headers = function(task, hdr_alterations, mode)
if mode == 'compat' then
-- Clear empty alterations in the compat mode
- if not next(add_headers) then add_headers = nil end
- if not next(hdr_alterations.remove) then hdr_alterations.remove = nil end
+ if add_headers and not next(add_headers) then add_headers = nil end
+ if hdr_alterations.remove and not next(hdr_alterations.remove) then hdr_alterations.remove = nil end
end
task:set_milter_reply({
add_headers = add_headers,