]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix corner cases
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 22 Oct 2022 12:17:45 +0000 (13:17 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 22 Oct 2022 12:17:45 +0000 (13:17 +0100)
lualib/lua_mime.lua

index 9dff5cfed88b8dcbe3e4b82447a7c44ad7dc0c91..038dccceb4d215a6c7d29cb41f0e3456f8f2e578 100644 (file)
@@ -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,