[#1374] Allow users to all all subprotocols by using * as wildcard
This commit is contained in:
parent
abb4e20d0b
commit
8a5e249d6f
@ -55,6 +55,11 @@ public abstract class WebSocketServerHandshaker {
|
||||
|
||||
private String selectedSubprotocol;
|
||||
|
||||
/**
|
||||
* Use this as wildcard to support all requested sub-protocols
|
||||
*/
|
||||
public final static String SUB_PROTOCOL_WILDCARD = "*";
|
||||
|
||||
/**
|
||||
* Constructor specifying the destination web socket location
|
||||
*
|
||||
@ -232,7 +237,8 @@ public abstract class WebSocketServerHandshaker {
|
||||
String requestedSubprotocol = p.trim();
|
||||
|
||||
for (String supportedSubprotocol: subprotocols) {
|
||||
if (requestedSubprotocol.equals(supportedSubprotocol)) {
|
||||
if (SUB_PROTOCOL_WILDCARD.equals(supportedSubprotocol)
|
||||
|| requestedSubprotocol.equals(supportedSubprotocol)) {
|
||||
return requestedSubprotocol;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user