From: Vsevolod Stakhov Date: Sun, 17 Aug 2014 16:03:04 +0000 (+0100) Subject: Write custom headers in the output. X-Git-Tag: 0.7.0~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac1dfb0beccf74a9f3ec82dfc257ea326532370d;p=thirdparty%2Frspamd.git Write custom headers in the output. --- diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 1b174b122d..650becbe4c 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);