MINOR: log/backend: prevent "dynamic-cookie-key" use with LOG mode

It doesn't make sense to set "dynamic-cookie-key" inside a log backend,
thus we report a warning to the user and reset the setting.
This commit is contained in:
Aurelien DARRAGON 2023-11-16 17:16:43 +01:00 committed by Willy Tarreau
parent c7783fb32b
commit 82f4bcafae
1 changed files with 7 additions and 0 deletions

View File

@ -922,6 +922,13 @@ static int _postcheck_log_backend_compat(struct proxy *be)
err_code |= ERR_WARN;
istfree(&be->server_id_hdr_name);
}
if (be->dyncookie_key) {
ha_warning("Cannot set \"dynamic-cookie-key\" with 'mode log' in %s '%s'. It will be ignored.\n",
proxy_type_str(be), be->id);
err_code |= ERR_WARN;
ha_free(&be->dyncookie_key);
}
return err_code;
}