BUG/MEDIUM: http-ana: Truncate the response when a redirect rule is applied
authorKevin Zhu <ip0tcp@gmail.com>
Tue, 7 Jan 2020 08:42:55 +0000 (09:42 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Jan 2020 09:50:28 +0000 (10:50 +0100)
commit96b363963f4a4a63823718966798f177a72936b6
tree366b08cbbdf7578076f44d31240a852647afd2e9
parent47a7210b9d377d91777f39241fab54d5f83b2728
BUG/MEDIUM: http-ana: Truncate the response when a redirect rule is applied

When a redirect rule is executed on the response path, we must truncate the
received response. Otherwise, the redirect is appended after the response, which
is sent to the client. So it is obviously a bug because the redirect is not
performed. With bodyless responses, it is the "only" bug. But if the response
has a body, the result may be invalid. If the payload is not fully received yet
when the redirect is performed, an internal error is reported.

It must be backported as far as 1.9.
src/http_ana.c