]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix x-os-fingerprint header 3112/head
authordenpamusic <denpa@netfleet.space>
Wed, 23 Oct 2019 08:34:32 +0000 (11:34 +0300)
committerdenpamusic <denpa@netfleet.space>
Wed, 23 Oct 2019 08:34:32 +0000 (11:34 +0300)
Pass correct parameter to add_header function and use double when unpacking integers from mempool

src/plugins/lua/milter_headers.lua

index 5d8d24c91dad1bb41970d5a44c9161a33e62c8ab..982b07dd0fa6445c77eafacad4dae7d7cf652f4f 100644 (file)
@@ -422,11 +422,11 @@ local function milter_headers(task)
 
     local os_string, link_type, uptime_min, distance =
       task:get_mempool():get_variable('os_fingerprint',
-        'string, string, int, int');
+        'string, string, double, double');
 
     if not os_string then return end
 
-    local value = string.format('%s, (up: %u min), (distance %i, link: %s)',
+    local value = string.format('%s, (up: %i min), (distance %i, link: %s)',
       os_string, uptime_min, distance, link_type)
 
     if settings.routines['x-os-fingerprint'].remove then
@@ -434,7 +434,7 @@ local function milter_headers(task)
         = settings.routines['x-os-fingerprint'].remove
     end
 
-    add_header(settings.routines['x-os-fingerprint'].header, value)
+    add_header('x-os-fingerprint', value)
   end
 
   routines['x-spam-status'] = function()