summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-19 18:44:30 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-19 18:44:30 +0100
commitc754796783ff1214d9c19c59082f52d67125e51b (patch)
tree3b6f095ecbaa72fa6f495ffa74a4de681a9b4811
parent0d993808484537046f93dd938a07e2e2c2e9ac87 (diff)
downloadrspamd-c754796783ff1214d9c19c59082f52d67125e51b.tar.gz
rspamd-c754796783ff1214d9c19c59082f52d67125e51b.zip
Fix headers arguments.
-rw-r--r--doc/rspamc.18
-rw-r--r--src/client/rspamc.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/rspamc.1 b/doc/rspamc.1
index d33f71bab..f3fda764d 100644
--- a/doc/rspamc.1
+++ b/doc/rspamc.1
@@ -183,6 +183,14 @@ Output the full mime message instead of scanning results only
.RS
.RE
.TP
+.B \-\-header=\f[I]header\f[]
+Add custom HTTP header for a request.
+You may specify header in format \f[C]name=value\f[] or just
+\f[C]name\f[] for an empty header.
+This option can be repeated multiple times.
+.RS
+.RE
+.TP
.B \-\-commands
List available commands
.RS
diff --git a/src/client/rspamc.c b/src/client/rspamc.c
index 7c0e76d5c..fbd27a912 100644
--- a/src/client/rspamc.c
+++ b/src/client/rspamc.c
@@ -437,7 +437,7 @@ add_options (GHashTable *opts)
hdr = http_headers;
- while (*hdr != NULL) {
+ while (hdr != NULL && *hdr != NULL) {
gchar **kv = g_strsplit_set (*hdr, ":=", 2);
if (kv == NULL || kv[1] == NULL) {