]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Adjust header case when chunked encoding is add to a message
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Oct 2019 08:23:51 +0000 (10:23 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Oct 2019 14:12:02 +0000 (16:12 +0200)
When an outgoing h1 message is formatted, if it is considered as chunked but the
corresponding header is missing, we add it. And as all other h1 headers, if
configured so, the case of this header must be adjusted.

No backport needed.

src/mux_h1.c

index 230903b6b0c74af5af1e3fc95e4387afa767a743..60461a819aeab20ea6d5936b56ed570ccaa32715 100644 (file)
@@ -1685,7 +1685,11 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun
                                     (h1m->flags & (H1_MF_VER_11|H1_MF_RESP|H1_MF_CLEN|H1_MF_CHNK|H1_MF_XFER_LEN)) ==
                                     (H1_MF_VER_11|H1_MF_RESP|H1_MF_XFER_LEN))) {
                                        /* chunking needed but header not seen */
-                                       if (!chunk_memcat(&tmp, "transfer-encoding: chunked\r\n", 28))
+                                       n = ist("transfer-encoding");
+                                       v = ist("chunked");
+                                       if (h1c->px->options2 & (PR_O2_H1_ADJ_BUGCLI|PR_O2_H1_ADJ_BUGSRV))
+                                               h1_adjust_case_outgoing_hdr(h1s, h1m, &n);
+                                       if (!htx_hdr_to_h1(n, v, &tmp))
                                                goto copy;
                                        TRACE_STATE("add \"Transfer-Encoding: chunked\"", H1_EV_TX_DATA|H1_EV_TX_HDRS, h1c->conn, h1s);
                                        h1m->flags |= H1_MF_CHNK;