BUG/MINOR: http-check: Don't pretend a C-L heeader is set before adding it
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 3 Feb 2025 17:36:17 +0000 (18:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Mar 2025 10:30:03 +0000 (11:30 +0100)
commit7383869241e59069684c9de4e3d6e6b10cb77fd9
treeb6503e4f163a0d1e7d6c5425e31e2f8d4084b7a7
parentd511b93d2d0d8083809b1ae0a2bfaaba76840941
BUG/MINOR: http-check: Don't pretend a C-L heeader is set before adding it

When a GET/HEAD/OPTIONS/DELETE healthcheck request was formatted, we claimed
there was a "content-length" header set even when there was no payload,
leading to actually send a "content-length: 0" header to the server. It was
unexpected and could be rejected by servers.

When a healthcheck request is sent we must take care to state there is a
"content-length" header when it is explicitly added.

This patch should fix the issue #2851. It must be backported as far as 2.9.

(cherry picked from commit fad68cb16d7f99acd2b327ff2f8a4d9ab88a68d8)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit d5ca78b83d7bfddd107e3243a6ff785dc92b9157)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/tcpcheck.c