diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-02-22 00:07:29 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-02-22 00:07:29 +0200 |
commit | 280a00474a4d27495c8d57351847ed2035eda9d0 (patch) | |
tree | a875bcddfa1805314e71b97287973c68cf227e63 /src/plugins/lua | |
parent | f4f98bdec17f34d30e1d54ad98c858fc42e3355c (diff) | |
download | rspamd-280a00474a4d27495c8d57351847ed2035eda9d0.tar.gz rspamd-280a00474a4d27495c8d57351847ed2035eda9d0.zip |
[Minor] Use JSON in metadata exporter HTTP metadata headers
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/metadata_exporter.lua | 8 |
1 files 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({ |