]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http: http_auth_bearer fetch does not work on custom header name
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Fri, 29 Oct 2021 13:25:19 +0000 (15:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 29 Oct 2021 15:40:17 +0000 (17:40 +0200)
commit7da35bff9fe29bd25e2dab89c68583bdc0ccd94c
treed65e050e641afc4171a5af1086b064605f7a82fa
parent68c4eae87f2366a9485f5d09250d7ec82d9a1b94
BUG/MINOR: http: http_auth_bearer fetch does not work on custom header name

The http_auth_bearer sample fetch can take a header name as parameter,
in which case it will try to extract a Bearer value out of the given
header name instead of the default "Authorization" one. In this case,
the extraction would not have worked because of a misuse of strncasecmp.
This patch fixes this by replacing the standard string functions by ist
ones.
It also properly manages the multiple spaces that could be found between
the scheme and its value.

No backport needed, that's part of JWT which is only in 2.5.

Co-authored-by: Tim Duesterhus <tim@bastelstu.be>
reg-tests/jwt/jws_verify.vtc
src/http_fetch.c