1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-30 00:00:16 +01:00

ws upgrade hs: require Host hdr

This commit is contained in:
Andy Green 2018-10-11 10:20:17 +08:00
parent db827733c3
commit 3696480b57

View file

@ -309,12 +309,21 @@ lws_process_ws_upgrade(struct lws *wsi)
default:
bad_conn_format:
lwsl_err("%s: malformed or absent connection hdr\n", __func__);
lwsl_err("%s: malformed or absent connection hdr\n",
__func__);
return 1;
}
} while (e > 0);
/* let's also confirm that Host at least exists for h1 */
if (!lws_hdr_total_length(wsi, WSI_TOKEN_HOST)) {
lwsl_err("%s: missing host: hdr on h1 ws upgrade\n", __func__);
return 1;
}
#if defined(LWS_WITH_HTTP2)
check_protocol:
#endif