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=refs%2Fpull%2F1445%2Fhead;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({