From: Andrew Lewis Date: Tue, 21 Feb 2017 22:07:29 +0000 (+0200) Subject: [Minor] Use JSON in metadata exporter HTTP metadata headers X-Git-Tag: 1.5.0~61^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=280a00474a4d27495c8d57351847ed2035eda9d0;p=rspamd.git [Minor] Use JSON in metadata exporter HTTP metadata headers --- 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({