]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: h1-htx: Keep flags about C-L/T-E during HEAD response parsing
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 2 Oct 2023 06:58:48 +0000 (08:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Oct 2023 13:34:18 +0000 (15:34 +0200)
When a response to a HEAD request is parsed, flags to know if the content
length is set or if the payload is chunked must be preserved.. It is
important because of the previous fix. Otherwise, these headers will be
removed from the response sent to the client.

This patch must only backported if "BUG/MEDIUM: mux-h1; Ignore headers
modifications about payload representation" is backported.

src/h1_htx.c

index 274fc39891f54036a0aa68c6626a932557554c0c..f0c525e6777f526ed769ae84d415a32a252aa278 100644 (file)
@@ -292,7 +292,6 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
        else if ((h1m->flags & H1_MF_METH_HEAD) || (code >= 100 && code < 200) ||
                 (code == 204) || (code == 304)) {
                /* Responses known to have no body. */
-               h1m->flags &= ~(H1_MF_CLEN|H1_MF_CHNK);
                h1m->flags |= H1_MF_XFER_LEN;
                h1m->curr_len = h1m->body_len = 0;
                flags |= HTX_SL_F_BODYLESS_RESP;