]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: hlua: reject interim responses in HTTP applets
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 19 Nov 2026 15:44:09 +0000 (16:44 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 19 Nov 2026 15:58:22 +0000 (16:58 +0100)
commita40022de1ef09495d010facfc4ab7fc4774e0978
tree3d1ff6fa38a3d2822aed17b53b7b76639002eee6
parentd66af5638b0de95bf3667210cc9916b628f2d9f7
BUG/MINOR: hlua: reject interim responses in HTTP applets

A Lua HTTP service may set a 1xx status. But it can only send one
response, so once the service returns, the interim response is ended
with the EOM flag, which the H1 and H2 muxes never do on a 1xx. The
stream forwards it as an interim response and, the applet being done,
produces a 502 while the interim response is still in the buffer. Since
commit 5fb43f017 ("MEDIUM: htx: Harden HTX API to avoid invalid uses
when EOM was reached") in 3.5-dev8, it crashes on
BUG_ON(htx_msg_ended(dst)). Before, the client got the interim response
followed by the 502.

Let's make start_response() raise a Lua error for interim responses
other than 101, so the service fails with a 500 as for any other error.
The documentation of set_status() was updated accordingly.

No backport needed.
doc/lua-api/index.rst
src/hlua.c