BUG/MEDIUM: log: emit '-' for empty fields again
Commit 2b0108ad accidently got rid of the ability to emit a "-" for
empty log fields. This can happen for captured request and response
cookies, as well as for fetches. Since we don't want to have this done
for headers however, we set the default log method when parsing the
format. It is still possible to force the desired mode using +M/-M.
diff --git a/src/proto_http.c b/src/proto_http.c
index da3935c..0040cbf 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -8109,7 +8109,7 @@
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, PR_MODE_HTTP);
+ parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.hdr_add.fmt, LOG_OPT_MANDATORY);
cur_arg += 2;
} else if (strcmp(args[0], "redirect") == 0) {
struct redirect_rule *redir;