From 280a00474a4d27495c8d57351847ed2035eda9d0 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Wed, 22 Feb 2017 00:07:29 +0200 Subject: [PATCH] [Minor] Use JSON in metadata exporter HTTP metadata headers --- src/plugins/lua/metadata_exporter.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/lua/metadata_exporter.lua b/src/plugins/lua/metadata_exporter.lua index c56f916ca..6e3f66fa5 100644 --- a/src/plugins/lua/metadata_exporter.lua +++ b/src/plugins/lua/metadata_exporter.lua @@ -223,10 +223,14 @@ local pushers = { end local hdrs = {} if rule.meta_headers then - local gm = get_general_metadata(task, true, true) + local gm = get_general_metadata(task, false, true) local pfx = rule.meta_header_prefix or 'X-Rspamd-' for k, v in pairs(gm) do - hdrs[pfx .. k] = v + if type(v) == 'table' then + hdrs[pfx .. k] = ucl.to_format(v, 'json-compact') + else + hdrs[pfx .. k] = v + end end end rspamd_http.request({ -- 2.39.5