From: Vsevolod Stakhov Date: Mon, 19 Oct 2015 17:44:30 +0000 (+0100) Subject: Fix headers arguments. X-Git-Tag: 1.0.7~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c754796783ff1214d9c19c59082f52d67125e51b;p=thirdparty%2Frspamd.git Fix headers arguments. --- diff --git a/doc/rspamc.1 b/doc/rspamc.1 index d33f71babf..f3fda764d7 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 7c0e76d5c4..fbd27a9124 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) {