From: Vsevolod Stakhov Date: Tue, 8 Sep 2020 14:28:42 +0000 (+0100) Subject: [Fix] Arc: Sort headers by their i= value X-Git-Tag: 2.6~69 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cc0cca0cf3a8762227f89f88150f41f4c0aee6c1;p=rspamd.git [Fix] Arc: Sort headers by their i= value --- 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)