]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-check: Don't set HTX_SL_F_BODYLESS flag with a log-format body
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Feb 2023 17:44:14 +0000 (18:44 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Feb 2023 17:44:15 +0000 (18:44 +0100)
When the HTTP request of a health-check is forged, we must not pretend there
is no payload, by setting HTX_SL_F_BODYLESS, if a log-format body was
configured.

Indeed, a test on the body length was used but it is only valid for a plain
string. For A log-format string, a list is used. Note it an bug with no
consequence for now.

This patch must be backported as far as 2.2.

src/tcpcheck.c

index bfe3a2c631c0d8afdd5665f01a9c11b85c3a52e9..07d16aa5d44897ceb2c14da2a0204cbbeeb495b5 100644 (file)
@@ -1412,7 +1412,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcpcheck_r
                    (istlen(vsn) == 8 && (*(vsn.ptr+5) > '1' || (*(vsn.ptr+5) == '1' && *(vsn.ptr+7) >= '1'))))
                        slflags |= HTX_SL_F_VER_11;
                slflags |= (HTX_SL_F_XFER_LEN|HTX_SL_F_CLEN);
-               if (!isttest(send->http.body))
+               if (!(send->http.flags & TCPCHK_SND_HTTP_FL_BODY_FMT) && !isttest(send->http.body))
                        slflags |= HTX_SL_F_BODYLESS;
 
                htx = htx_from_buf(&check->bo);