protected boolean isWebSocketsUpgradeRequest(HttpRequest request) {
        String connectionHeader = request.getHeader( Names.CONNECTION );
        String upgradeHeader = request.getHeader( Names.UPGRADE );

        if (connectionHeader == null || upgradeHeader == null) {
            return false;
        }

        if (connectionHeader.trim().toLowerCase().contains( Values.UPGRADE.toLowerCase() )) {
            if (upgradeHeader.trim().equalsIgnoreCase( Values.WEBSOCKET )) {
                return true;
            }
        }

        return false;
    }
protected boolean isWebSocketsUpgradeRequest ( HttpRequest request ) { String connectionHeader = request . getHeader ( Names . CONNECTION ) ; String upgradeHeader = request . getHeader ( Names . UPGRADE ) ; if ( connectionHeader == null || upgradeHeader == null ) { return false ; } if ( connectionHeader . trim ( ) . toLowerCase ( ) . contains ( Values . UPGRADE . toLowerCase ( ) ) ) { if ( upgradeHeader . trim ( ) . equalsIgnoreCase ( Values . WEBSOCKET ) ) { return true ; } } return false ; }
Determine if this request represents a web-socket upgrade request.

@param request The request to inspect.
@return <code>true</code> if this request is indeed a web-socket upgrade
request, otherwise <code>false</code>.