Skip to content

Commit 5a7289b

Browse files
committed
avoid new string, connection must be upgrade for websocket
1 parent e67636b commit 5a7289b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/robaho/net/httpserver/websockets/WebSocketHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void handle(HttpExchange exchange) throws IOException {
5959
public static boolean isWebsocketRequested(Headers headers) {
6060
// check if Upgrade connection
6161
String connection = headers.getFirst(Util.HEADER_CONNECTION);
62-
if (connection == null || !connection.toLowerCase().contains(Util.HEADER_CONNECTION_VALUE.toLowerCase())) {
62+
if (connection == null || !connection.equalsIgnoreCase(Util.HEADER_CONNECTION_VALUE)) {
6363
return false;
6464
}
6565
// check for proper upgrade tyoe

0 commit comments

Comments
 (0)