]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: sample: return the decoded JWT part when no path is given
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Sep 2026 20:16:59 +0000 (20:16 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:11:24 +0000 (16:11 +0200)
commit3649a130ee650478448a4b057688f8a1a051aa52
tree231ed754d75d8f33ed89f50fcab122c59af7163b
parent84e4da5cdf68430c87f2dc42f31c470eefd8bb95
BUG/MINOR: sample: return the decoded JWT part when no path is given

jwt_header_query() and jwt_payload_query() are documented to return the
decoded header or payload of the token when they are called without any
argument. sample_conv_jwt_member_query() does fill the sample in that
case, but it jumps to its exit label while <retval> still holds the
zero it was initialized with, so the converter reports a failure and
the expression yields nothing at all.

Only the form taking a JSON path worked, which is the one the reg-test
used, hence the bug going unnoticed. The test now reads both parts of
the token without any argument as well.

The issue arrived in 2.5 with the original commit 0a72f5ee7c ("MINOR:
jwt: jwt_header_query and jwt_payload_query converters") so this fix
can be backported to all stable branches.
reg-tests/jwt/jws_verify.vtc
src/sample.c