From 7a991a9b83526b5000349b185186b0797d9fe080 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 4 Oct 2019 10:23:51 +0200 Subject: [PATCH] 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. --- src/mux_h1.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mux_h1.c b/src/mux_h1.c index 230903b..60461a8 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; -- 1.7.10.4