]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: parse the content-length header on output and set H1_MF_CLEN
authorWilly Tarreau <w@1wt.eu>
Thu, 3 Jan 2019 20:52:42 +0000 (21:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 3 Jan 2019 21:25:52 +0000 (22:25 +0100)
The H1_MF_CLEN flag is needed to figure whether a content-length header is
present or not when producing a request, so let's check it on output just
like we already check the transfer-encoding header.

src/mux_h1.c

index 4df1289ea9bb7d49da14657f23d8570120a2c1ad..56937391f539cb307b512eeedabc0323f27869a6 100644 (file)
@@ -1538,6 +1538,10 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun
 
                                if (isteqi(n, ist("transfer-encoding")))
                                        h1_parse_xfer_enc_header(h1m, v);
+                               else if (isteqi(n, ist("content-length"))) {
+                                       if (h1_parse_cont_len_header(h1m, &v) <= 0)
+                                               goto skip_hdr;
+                               }
                                else if (isteqi(n, ist("connection"))) {
                                        h1_parse_connection_header(h1m, v);
                                        h1_process_conn_mode(h1s, h1m, NULL, &v);