From 3bfeadb3f6d0cdb924847a98669f8e908a224169 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 24 Mar 2013 07:33:22 +0100 Subject: [PATCH] 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. --- src/proto_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto_http.c b/src/proto_http.c index 0040cbfd1..2fa75980f 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;