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.
This commit is contained in:
Christopher Faulet 2019-10-04 10:23:51 +02:00
parent 5cef2a6d84
commit 7a991a9b83

View 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;