@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2023 the original author or authors .
* Copyright 2002 - 2024 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -23,6 +23,7 @@ import java.util.ArrayList;
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Arrays ;
import java.util.Collections ;
import java.util.List ;
import java.util.Locale ;
import java.util.Map ;
import org.apache.commons.logging.Log ;
@ -154,7 +155,7 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
@@ -154,7 +155,7 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
public void setSupportedProtocols ( String . . . protocols ) {
this . supportedProtocols . clear ( ) ;
for ( String protocol : protocols ) {
this . supportedProtocols . add ( protocol . toLowerCase ( ) ) ;
this . supportedProtocols . add ( protocol . toLowerCase ( Locale . ROOT ) ) ;
}
}
@ -329,10 +330,10 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
@@ -329,10 +330,10 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
protected String selectProtocol ( List < String > requestedProtocols , WebSocketHandler webSocketHandler ) {
List < String > handlerProtocols = determineHandlerSupportedProtocols ( webSocketHandler ) ;
for ( String protocol : requestedProtocols ) {
if ( handlerProtocols . contains ( protocol . toLowerCase ( ) ) ) {
if ( handlerProtocols . contains ( protocol . toLowerCase ( Locale . ROOT ) ) ) {
return protocol ;
}
if ( this . supportedProtocols . contains ( protocol . toLowerCase ( ) ) ) {
if ( this . supportedProtocols . contains ( protocol . toLowerCase ( Locale . ROOT ) ) ) {
return protocol ;
}
}