]> source.dussan.org Git - rspamd.git/commitdiff
Write custom headers in the output.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 17 Aug 2014 16:03:04 +0000 (17:03 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 17 Aug 2014 16:03:04 +0000 (17:03 +0100)
src/libserver/protocol.c

index 1b174b122dd23cecee6e7482fdb0708e1d109298..650becbe4cde2b346c43508bfd6e257fb0477502 100644 (file)
@@ -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);