]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log/backend: prevent "http-send-name-header" use with LOG mode
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 16 Nov 2023 16:11:37 +0000 (17:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 18 Nov 2023 10:16:21 +0000 (11:16 +0100)
It doesn't make sense to use the "http-send-name-header" directive inside
a log backend so we report a warning in with case and reset the setting.

src/log.c

index f9a4e26b2670b3a3dbacf1778555e037853202aa..e12a43b7f2c179843ead9b54130257dcffea6ea8 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -915,6 +915,13 @@ static int _postcheck_log_backend_compat(struct proxy *be)
                free_stick_rules(&be->storersp_rules);
                free_stick_rules(&be->sticking_rules);
        }
+       if (isttest(be->server_id_hdr_name)) {
+               ha_warning("Cannot set \"server_id_hdr_name\" with 'mode log' in %s '%s'. It will be ignored.\n",
+                          proxy_type_str(be), be->id);
+
+               err_code |= ERR_WARN;
+               istfree(&be->server_id_hdr_name);
+       }
        return err_code;
 }