]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h1-htx: Increment body len when parsing a payload with no xfer length
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 18 Sep 2025 06:00:26 +0000 (08:00 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Oct 2025 09:01:36 +0000 (11:01 +0200)
In the H1 parseur, the body length was only incremented when the transfer
length was known. So when the content-length was specified or when the
transfer-encoding value was set to "chunk".

Now for messages with unknown transfer length, it is also incremented. It is
mandatory to be able to remove the extra field from the HTX message.

src/h1_htx.c

index 83e241e5379939086c8494ff48fbbcbf2e9166f9..4da1896c38ed12d8e19fb9170706bf83152f7871 100644 (file)
@@ -908,6 +908,7 @@ size_t h1_parse_msg_data(struct h1m *h1m, struct htx **dsthtx,
                sz = b_data(srcbuf) - ofs;
                sz = h1_copy_msg_data(dsthtx, srcbuf, ofs, sz, max, htxbuf);
                total += sz;
+               h1m->body_len += sz;
        }
 
        return total;