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 .