From: Willy Tarreau Date: Sun, 24 Mar 2013 06:33:22 +0000 (+0100) Subject: BUG/MEDIUM: http: add-header should not emit "-" for empty fields X-Git-Tag: v1.5-dev18~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bfeadb3f6d0cdb924847a98669f8e908a224169;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: http: add-header should not emit "-" for empty fields Patch 6cbbdbf3 fixed the missing "-" delimitors in logs but it caused them to be emitted with "http-request add-header", eventhough it was correctly fixed for the unique-id format. Fix this by simply removing LOG_OPT_MANDATORY in this case. --- diff --git a/src/proto_http.c b/src/proto_http.c index 0040cbfd13..2fa75980f6 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -8109,7 +8109,7 @@ struct http_req_rule *parse_http_req_cond(const char **args, const char *file, i rule->arg.hdr_add.name = strdup(args[cur_arg]); rule->arg.hdr_add.name_len = strlen(rule->arg.hdr_add.name); LIST_INIT(&rule->arg.hdr_add.fmt); - parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.hdr_add.fmt, LOG_OPT_MANDATORY); + parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.hdr_add.fmt, 0); cur_arg += 2; } else if (strcmp(args[0], "redirect") == 0) { struct redirect_rule *redir;