http1: make CONNECT change protocol at any tx

and not just the first one

Ticket: 9201

Follows RFC9110 section 3.3 :
For example, a CONNECT request (Section 9.3.6) or a request with
the Upgrade header field (Section 7.8) can occur at any time,
not just in the first message on a connection.
pull/16516/head
Philippe Antoine 1 day ago
parent 9a37bb659b
commit 542ef7684b

@ -1817,7 +1817,7 @@ static int HTPCallbackResponseComplete(const htp_connp_t *connp, htp_tx_t *tx)
/* any 2XX status response implies that the connection will become
a tunnel immediately after this packet (RFC 7230, 3.3.3). */
if ((htp_tx_response_status_number(tx) >= 200) &&
(htp_tx_response_status_number(tx) < 300) && (hstate->transaction_cnt == 1)) {
(htp_tx_response_status_number(tx) < 300)) {
uint16_t dp = 0;
if (htp_tx_request_port_number(tx) != -1) {
dp = (uint16_t)htp_tx_request_port_number(tx);

Loading…
Cancel
Save