BUG/MEDIUM: h1: Ignore C-L value in the H1 parser if T-E is also set
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 27 Sep 2023 13:21:28 +0000 (15:21 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Oct 2023 13:34:18 +0000 (15:34 +0200)
commite7964eac2d3fc2b831f82b6b2825de3c5cdd5912
tree5e88b0493ecc411dfb499b32647eaf874dcd61c7
parentc367957851b17f1c153c4d0f75add35dea957d51
BUG/MEDIUM: h1: Ignore C-L value in the H1 parser if T-E is also set

In fact, during the parsing there is already a test to remove the
Content-Length header if a Transfer-Encoding one is found. However, in the
parser, the content-length value was still used to set the body length (the
final one and the remaining one). This value is thus also used to set the
extra field in the HTX message and is then used during the sending stage to
announce the chunk size.

So, Content-Length header value must be ignored by the H1 parser to properly
reformat the message when it is sent.

This patch must be backported as far as 2.6. Lower versions don"t handle
this case.
src/h1.c