]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use JSON in metadata exporter HTTP metadata headers 1445/head
authorAndrew Lewis <nerf@judo.za.org>
Tue, 21 Feb 2017 22:07:29 +0000 (00:07 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 21 Feb 2017 22:07:29 +0000 (00:07 +0200)
src/plugins/lua/metadata_exporter.lua

index c56f916ca75d56670e6ad6be582b9ef3a48b8c24..6e3f66fa5abd2e52c9d619a8b4a49111ee0f3595 100644 (file)
@@ -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({