BUG/MINOR: http-ana: Don't send payload for internal responses to HEAD requests
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 19 Oct 2020 16:01:38 +0000 (18:01 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Nov 2020 15:01:33 +0000 (16:01 +0100)
commit9f2525c4deec286bf3a94bccaa140ba62ce37bdc
treec089a3b1bb8de881b157e0c7fb329798d6918176
parent4606476f7be9ed71440f46a5ed0141b0f146c822
BUG/MINOR: http-ana: Don't send payload for internal responses to HEAD requests

When an internal response is returned to a client, the message payload must be
skipped if it is a reply to a HEAD request. The payload is removed from the HTX
message just before the message forwarding.

This bugs has been around for a long time. It was already there in the pre-HTX
versions. In legacy HTTP mode, internal errors are not parsed. So this bug
cannot be easily fixed. Thus, this patch should only be backported in all HTX
versions, as far as 2.0. However, the code has significantly changed in the
2.2. Thus in the 2.1 and 2.0, the patch must be entirely reworked.

(cherry picked from commit d6c48366b81e4f95676b038db32d23cdc541735e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 0471ef6514cc9f07e1096b878f3e47baf3692d08)
[cf: adapted for the 2.1, as expected. ]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/common/htx.h
src/http_ana.c