]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: proxy: Remove dead code when parsing "http-restrict-req-hdr-names" option
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 May 2022 12:46:15 +0000 (14:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 May 2022 14:13:22 +0000 (16:13 +0200)
negation or default modifiers are not supported for this option. However,
this was already tested earlier in cfg_parse_listen() function. Thus, when
"http-restrict-req-hdr-names" option is parsed, the keyword modifier is
always equal to KWM_STD. It is useless to test it again at this place.

This patch should solve the issue #1702.

src/cfgparse-listen.c

index e7cd65146f4e7b69bdc6564312bc64f1d7492f6b..1bff2cdd2dcf0d892780d9f6961a99ecbd247c31 100644 (file)
@@ -2460,13 +2460,6 @@ stats_error_parsing:
                        } /* end while loop */
                }
                else if (strcmp(args[1], "http-restrict-req-hdr-names") == 0) {
-                       if (kwm != KWM_STD) {
-                               ha_alert("parsing [%s:%d]: negation/default is not supported for option '%s'.\n",
-                                        file, linenum, args[1]);
-                               err_code |= ERR_ALERT | ERR_FATAL;
-                               goto out;
-                       }
-
                        if (alertif_too_many_args(2, file, linenum, args, &err_code))
                                goto out;