From ac1dfb0beccf74a9f3ec82dfc257ea326532370d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 17 Aug 2014 17:03:04 +0100 Subject: [PATCH] Write custom headers in the output. --- src/libserver/protocol.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 1b174b122..650becbe4 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -751,6 +751,15 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg, if (!task->no_log) { rspamd_roll_history_update (task->worker->srv->history, task); } + + /* Write custom headers */ + g_hash_table_iter_init (&hiter, task->reply_headers); + while (g_hash_table_iter_next (&hiter, &h, &v)) { + GString *hn = (GString *)h, *hv = (GString *)v; + + rspamd_http_message_add_header (msg, hn->str, hv->str); + } + g_hash_table_iter_init (&hiter, task->results); top = ucl_object_typed_new (UCL_OBJECT); -- 2.39.5