]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: http-fetch: http_auth_bearer() must not match a missing header
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Sep 2026 04:37:37 +0000 (04:37 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Sep 2026 12:05:26 +0000 (14:05 +0200)
commit39e4fe6e33e599cbc8fa700a6218a5fe6eb7ab47
treebc00cfae2378435b693e6ab754de4103de243ad4
parent49c353d06a9c9dfed566837b0a3822fcb58fe54d
BUG/MINOR: http-fetch: http_auth_bearer() must not match a missing header

When http_auth_bearer() was called with a custom header name and this header
was not found, the fetch still succeeded and returned an empty string. So a
condition like "{ http_auth_bearer(x-tok) -m found }" was true for a request
without any such header.

Commit 909578520 ("BUG/MINOR: http-fetch: Fix http_auth_bearer() when custom
header is used") intended to report a mismatch in this case, as its message
says, but only did it for a header with a wrong type.

Let's return 0 when the header is not found. A reg-test is added for the
fetch with and without a custom header.

This should be backported as far as 2.6.
reg-tests/sample_fetches/http_auth_bearer.vtc [new file with mode: 0644]
src/http_fetch.c