Skip to content

Commit 855a5bd

Browse files
committed
Fix overly aggressive connection checking for clients that send multiple values on the 'Connection:' header
1 parent 51e664d commit 855a5bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Assets/WebSocketServer/WebSocketProtocol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static bool CheckConnectionHandshake(RequestHeader request) {
7575
}
7676

7777
// Must have a Connection: Upgrade
78-
if (!request.headers.ContainsKey("Connection") || !String.Equals(request.headers["Connection"], "Upgrade")) {
78+
if (!request.headers.ContainsKey("Connection") || request.headers["Connection"].IndexOf("Upgrade") == -1) {
7979
Debug.Log("Request does not have Connection: Upgrade.");
8080
return false;
8181
}

0 commit comments

Comments
 (0)