During H1 message parsing, the Upgrade header values are checked to detect
"websocket" prototol, to properly handle websocket upgrades between H1 and
H2 and to possibly reject messages if mandatory headers are missing.
However, the flag is reset for each new Upgrade header and the information
may be lost. So never reset it.
This patch must be backported as far as 2.4.
} -run
# missing websocket key
-client c2 -connect ${hap_fe1_sock} {
+client c2_1 -connect ${hap_fe1_sock} {
txreq \
-req "GET" \
-url "/" \
expect resp.status == 400
} -run
+client c2_2 -connect ${hap_fe1_sock} {
+ txreq \
+ -req "GET" \
+ -url "/" \
+ -hdr "host: 127.0.0.1" \
+ -hdr "connection: upgrade" \
+ -hdr "upgrade: proto1, websocket, proto2" \
+ -hdr "upgrade: proto3"
+
+ rxresp
+ expect resp.status == 400
+} -run
+
# missing key on server side
client c3 -connect ${hap_fe2_sock} {
txreq \
char *e, *n, *p;
struct ist word;
- h1m->flags &= ~H1_MF_UPG_WEBSOCKET;
-
word.ptr = value->ptr - 1; // -1 for next loop's pre-increment
p = value->ptr;
e = value->ptr + value->len;