]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http_fetch: Fix http_auth/http_auth_group when called from TCP rules
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 15 Jul 2019 11:58:29 +0000 (13:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Jul 2019 07:18:27 +0000 (09:18 +0200)
commitcd7619506173562eea92abde034eb44dce23d53b
tree7b1b31e286e7dc015b08d521e7aa0fea584ffdac
parent6d36e1c282d8b27752f35595a4bf09e5d58f3990
BUG/MINOR: http_fetch: Fix http_auth/http_auth_group when called from TCP rules

These sample fetches rely on the static fnuction get_http_auth(). For HTX
streams and TCP proxies, this last one gets its HTX message from the request's
channel. When called from an HTTP rule, There is no problem. Bu when called from
TCP rules for a TCP proxy, this buffer is a raw buffer not an HTX message. For
instance, using the following TCP rule leads to a crash :

  tcp-request content accept if { http_auth(Users) }

To fix the bug, we must rely on the HTX message returned by the function
smp_prefetch_htx(). So now, the HTX message is passed as argument to the
function get_http_auth().

This patch must be backported to 2.0 and 1.9.
src/http_fetch.c