From: Aurelien DARRAGON Date: Tue, 19 Sep 2023 16:34:15 +0000 (+0200) Subject: MINOR: cfgparse-listen: "http-send-name-header" requires TCP or HTTP mode X-Git-Tag: v2.9-dev7~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d354947365bbbafe3f6675fec0bea8617259842a;p=thirdparty%2Fhaproxy.git MINOR: cfgparse-listen: "http-send-name-header" requires TCP or HTTP mode Prevent the use of the "http-send-name-header" keyword in proxy section when neither TCP or HTTP mode is set. --- diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index f513207e61..f8330a6e03 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -1315,6 +1315,13 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL)) err_code |= ERR_WARN; + if (curproxy->mode != PR_MODE_TCP && curproxy->mode != PR_MODE_HTTP) { + ha_alert("parsing [%s:%d] : '%s' requires TCP or HTTP mode.\n", + file, linenum, args[0]); + err_code |= ERR_ALERT | ERR_FATAL; + goto out; + } + if (!*args[1]) { ha_alert("parsing [%s:%d] : '%s' requires a header string.\n", file, linenum, args[0]);