204 and 1xx responses must not have any payload. Now, the H1 mux takes care
of that in last resort. But they also must not have any C-L or T-E
headers. Thus, if found on the sending path, these headers are ignored.
if (*(n.ptr) == ':')
goto skip_hdr;
- if (isteq(n, ist("transfer-encoding")))
+ if (isteq(n, ist("transfer-encoding"))) {
+ if ((h1m->flags & H1_MF_RESP) && (h1s->status < 200 || h1s->status == 204))
+ goto skip_hdr;
h1_parse_xfer_enc_header(h1m, v);
+ }
else if (isteq(n, ist("content-length"))) {
+ if ((h1m->flags & H1_MF_RESP) && (h1s->status < 200 || h1s->status == 204))
+ goto skip_hdr;
/* Only skip C-L header with invalid value. */
if (h1_parse_cont_len_header(h1m, &v) < 0)
goto skip_hdr;