]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: log/encode: consider global options for key encoding
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 29 Apr 2024 13:31:17 +0000 (15:31 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 30 Apr 2024 08:10:35 +0000 (10:10 +0200)
commit949ac95aa6d69d810cd6ed40138f033f5065e305
tree782f81949a6786bdf0d47d21bd3c6ce0119799b3
parent6b634c4779c25f33cb3295ae43c91955a024cada
BUG/MINOR: log/encode: consider global options for key encoding

In sess_build_logline(), contrary to what's stated in the comment
"only consider global ctx for key encoding", we check for
LOG_OPT_ENCODE flag on the current ctx options instead of global
ones. Because of this, we could end up doing the wrong thing if the
previous node had encoding enabled but it isn't set globally for
instance.

To fix the issue, let's simply check the presence of the flag on
g_options before entering the "key encoding" block.

This bug was introduced with 3f7c8387 ("MINOR: log: add +json encoding
option"), no backport needed.
src/log.c