From: Azat Khuzhin Date: Sat, 12 Nov 2022 17:45:13 +0000 (+0100) Subject: ws: ignore case while comparing values of Upgrade/Connection headers X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56d380b9b6d07839b688dd1355828182a021b03e;p=libevent ws: ignore case while comparing values of Upgrade/Connection headers Cc: @widgetii Fixes: #1373 --- diff --git a/ws.c b/ws.c index 5acaf783..8e2b2958 100644 --- a/ws.c +++ b/ws.c @@ -353,11 +353,11 @@ evws_new_session( in_hdrs = evhttp_request_get_input_headers(req); upgrade = evhttp_find_header(in_hdrs, "Upgrade"); - if (upgrade == NULL || strcmp(upgrade, "websocket")) + if (upgrade == NULL || evutil_ascii_strcasecmp(upgrade, "websocket")) goto error; connection = evhttp_find_header(in_hdrs, "Connection"); - if (connection == NULL || strcmp(connection, "Upgrade")) + if (connection == NULL || evutil_ascii_strcasecmp(connection, "Upgrade")) goto error; ws_key = evhttp_find_header(in_hdrs, "Sec-WebSocket-Key");