summaryrefslogtreecommitdiffstats
path: root/src/libutil/http.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-11 12:56:44 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-11 12:56:44 +0000
commit8cb0e4aa8199af52316806f41f1a7cd1e25ceedb (patch)
tree0a5a8519ea3e5ec5be32bf72d9d9e99086aec7ab /src/libutil/http.h
parent4784b2685577df0f0e1263d024dc073e571b0328 (diff)
downloadrspamd-8cb0e4aa8199af52316806f41f1a7cd1e25ceedb.tar.gz
rspamd-8cb0e4aa8199af52316806f41f1a7cd1e25ceedb.zip
[Minor] Allow to append headers for rspamd http router
Diffstat (limited to 'src/libutil/http.h')
-rw-r--r--src/libutil/http.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libutil/http.h b/src/libutil/http.h
index 0e828d3ff..f41c3ee31 100644
--- a/src/libutil/http.h
+++ b/src/libutil/http.h
@@ -127,6 +127,7 @@ struct rspamd_http_connection_entry {
struct rspamd_http_connection_router {
struct rspamd_http_connection_entry *conns;
GHashTable *paths;
+ GHashTable *response_headers;
GPtrArray *regexps;
struct timeval tv;
struct timeval *ptv;
@@ -457,6 +458,23 @@ void rspamd_http_router_set_key (struct rspamd_http_connection_router *router,
void rspamd_http_router_add_path (struct rspamd_http_connection_router *router,
const gchar *path, rspamd_http_router_handler_t handler);
+/**
+ * Add custom header to append to router replies
+ * @param router
+ * @param name
+ * @param value
+ */
+void rspamd_http_router_add_header (struct rspamd_http_connection_router *router,
+ const gchar *name, const gchar *value);
+
+/**
+ * Inserts router headers to the outbound message
+ * @param router
+ * @param msg
+ */
+void rspamd_http_router_insert_headers (struct rspamd_http_connection_router *router,
+ struct rspamd_http_message *msg);
+
struct rspamd_regexp_s;
/**
* Adds new pattern to router, regexp object is refcounted by this function