From 56d380b9b6d07839b688dd1355828182a021b03e Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 12 Nov 2022 18:45:13 +0100 Subject: [PATCH] ws: ignore case while comparing values of Upgrade/Connection headers Cc: @widgetii Fixes: #1373 --- ws.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ws.c b/ws.c index 5acaf78397..8e2b29583a 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");