]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: http-ana: return a 502 when checkcache blocks a response
authorWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 09:03:34 +0000 (11:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:11:24 +0000 (16:11 +0200)
commit9802e33a3f8555f3a6e84eed71cb43e28204b978
tree808ac8805b4c74de2a9a51e28ab457d92bbe2d97
parent6ac63b4b9969a9685d58007a36a2fb959dcd4ea5
BUG/MINOR: http-ana: return a 502 when checkcache blocks a response

The documentation of "option checkcache" states that a response which
does not respect its requirements "will be blocked just as if it was
from an http-response deny rule, with an HTTP 502 bad gateway".

The code jumps to the "deny" label without touching txn->status, which
at that point still holds the status the server had returned. The
response delivered to the client is thus a 200 (or anything else that
the server returned), and the error files are not even used in this
case. Let's just properly set the status to 502 just like the other
rules such as "http-response deny" do. It now does what the doc says.

This has been there forever so it can be backported to all stable
branches.
src/http_ana.c