aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/arc.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-09-08 15:28:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-09-08 15:28:42 +0100
commitcc0cca0cf3a8762227f89f88150f41f4c0aee6c1 (patch)
tree5805f6f2b089efcc8fed7547f371ea6e9d9d6467 /src/plugins/lua/arc.lua
parente12a0910cf46c93ce7a2210d0d8a91c4b538f589 (diff)
downloadrspamd-cc0cca0cf3a8762227f89f88150f41f4c0aee6c1.tar.gz
rspamd-cc0cca0cf3a8762227f89f88150f41f4c0aee6c1.zip
[Fix] Arc: Sort headers by their i= value
Diffstat (limited to 'src/plugins/lua/arc.lua')
-rw-r--r--src/plugins/lua/arc.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua
index ce6f1e02e..dc10476d7 100644
--- a/src/plugins/lua/arc.lua
+++ b/src/plugins/lua/arc.lua
@@ -121,6 +121,11 @@ local function parse_arc_header(hdr, target)
target[i].header = hdr[i].decoded
target[i].raw_header = hdr[i].value
end
+
+ -- sort by i= attribute
+ table.sort(target, function(a, b)
+ return (a.i or 0) < (b.i or 0)
+ end)
end
local function arc_validate_seals(task, seals, sigs, seal_headers, sig_headers)