]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Encode headers in metadata exporter 4816/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 13 Feb 2024 15:15:26 +0000 (15:15 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 13 Feb 2024 15:15:26 +0000 (15:15 +0000)
Issue: #4808

src/plugins/lua/metadata_exporter.lua

index 7b353b8d2ce8d0634aa2d8826470d4321b4eee16..d8a1bd6c5448041258b2a705ccedc2b2ecc32405 100644 (file)
@@ -323,10 +323,11 @@ local pushers = {
         if type(v) == 'table' then
           hdrs[pfx .. k] = ucl.to_format(v, 'json-compact')
         else
-          hdrs[pfx .. k] = v
+          hdrs[pfx .. k] = rspamd_util.mime_header_encode(v)
         end
       end
     end
+
     rspamd_http.request({
       task = task,
       url = rule.url,
@@ -366,12 +367,12 @@ local pushers = {
       return true
     end
     rspamd_tcp.request({
-      task=task,
-      host=rule.host,
-      port=rule.port,
-      data=formatted,
-      callback=json_raw_tcp_callback,
-      read=false,
+      task = task,
+      host = rule.host,
+      port = rule.port,
+      data = formatted,
+      callback = json_raw_tcp_callback,
+      read = false,
     })
   end,
 }