]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Arc: Sort headers by their i= value
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Sep 2020 14:28:42 +0000 (15:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Sep 2020 14:28:42 +0000 (15:28 +0100)
src/plugins/lua/arc.lua

index ce6f1e02e62a2dc65d0a2abd688bd74a2aa12134..dc10476d7cc28bbe5f243fdfe5c0d6c52553b5d7 100644 (file)
@@ -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)