From: Christopher Faulet Date: Fri, 4 Oct 2019 08:23:51 +0000 (+0200) Subject: BUG/MINOR: mux-h1: Adjust header case when chunked encoding is add to a message X-Git-Tag: v2.1-dev3~142 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a991a9b83526b5000349b185186b0797d9fe080;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-h1: Adjust header case when chunked encoding is add to a message 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. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 230903b6b0..60461a819a 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -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;