Skip to content

Commit

Permalink
ws: ignore case while comparing values of Upgrade/Connection headers
Browse files Browse the repository at this point in the history
  • Loading branch information
azat committed Nov 12, 2022
1 parent 8482e22 commit 56d380b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 56d380b

Please sign in to comment.