Use case in-sensitive matching for sec-websocket-key header (#7454)

This commit is contained in:
frytimo
2025-08-13 01:21:55 -03:00
committed by GitHub
parent 62c7d6a4c4
commit 8230709d62

View File

@@ -762,7 +762,7 @@ class websocket_service extends service {
break;
}
}
if (!preg_match("/Sec-WebSocket-Key: (.*)\r\n/", $request_header, $matches)) {
if (!preg_match("/Sec-WebSocket-Key: (.*)\r\n/i", $request_header, $matches)) {
throw new invalid_handshake_exception($resource, "Invalid WebSocket handshake");
}
$key = trim($matches[1]);