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.
This commit is contained in:
Willy Tarreau 2013-03-24 07:33:22 +01:00
parent dad36a3ee3
commit 3bfeadb3f6

View File

@ -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;