On the backend side, a HEADERS frame carrying a 1xx status with the FIN
bit is converted into an interim response ending the message with the
EOM flag, which the H1 and H2 muxes never do. The stream forwards it as
an interim response and the client then gets a 502 once the end of the
stream is reported, while such a response is malformed since a final
response must follow an interim one.
Let's reject it as a malformed response with H3_ERR_MESSAGE_ERROR, as
the H2 mux does with an END_STREAM flag on a 1xx response, so the client
only gets a 502.
This was introduced with the backend side support by commit
f79effa30
("MINOR: h3: convert HTTP/3 response into HTX for backend side support")
in 3.3-dev2, so it must be backported to 3.3.
goto out;
}
+ /* a final response must follow an interim one */
+ if (h == 1 && fin) {
+ TRACE_ERROR("interim response ending the stream", H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);
+ h3s->err = H3_ERR_MESSAGE_ERROR;
+ qcc_report_glitch(qcs->qcc, 1);
+ len = -1;
+ goto out;
+ }
+
sl = htx_add_stline(htx, HTX_BLK_RES_SL, flags, ist("HTTP/3.0"), status, ist(""));
if (!sl) {
TRACE_ERROR("cannot allocate HTX start-line", H3_EV_RX_FRAME|H3_EV_RX_HDR, qcs->qcc->conn, qcs);