diff --git a/include/haproxy/h2.h b/include/haproxy/h2.h index 430774e76..1c76fa4bd 100644 --- a/include/haproxy/h2.h +++ b/include/haproxy/h2.h @@ -182,7 +182,8 @@ enum h2_err { #define H2_MSGF_RSP_1XX 0x0010 // a 1xx ( != 101) HEADERS frame was received #define H2_MSGF_BODYLESS_RSP 0x0020 // response message is known to have no body // (response to HEAD request or 204/304 response) -#define H2_MSGF_EXT_CONNECT 0x0040 // Extended CONNECT method from rfc 8441 +#define H2_MSGF_EXT_CONNECT 0x0040 // Extended CONNECT method from rfc 8441 is in use +#define H2_MSGF_EXT_CONN_OK 0x0080 // Extended CONNECT is permitted #define H2_MAX_STREAM_ID ((1U << 31) - 1) #define H2_MAX_FRAME_LEN ((1U << 24) - 1) diff --git a/src/mux_h2.c b/src/mux_h2.c index 61e7db54b..4d1bef4b2 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6285,7 +6285,10 @@ next_frame: msgf = (h2c->dff & H2_F_HEADERS_END_STREAM) ? 0 : H2_MSGF_BODY; msgf |= (*flags & H2_SF_BODY_TUNNEL) ? H2_MSGF_BODY_TUNNEL: 0; /* If an Extended CONNECT has been sent on this stream, set message flag - * to convert 200 response to 101 htx response */ + * to convert 200 response to 101 htx response. We only support this if + * the connection supports RFC8441. + */ + msgf |= (h2c->flags & H2_CF_RCVD_RFC8441) ? H2_MSGF_EXT_CONN_OK : 0; msgf |= (*flags & H2_SF_EXT_CONNECT_SENT) ? H2_MSGF_EXT_CONNECT: 0; /* when dealing with trailers, we need to check the content-length */