private boolean containsUpgradeHeaders ( HttpRequest httpRequest ) { HttpHeaders headers = httpRequest . headers ( ) ; return headers . containsValue ( HttpHeaderNames . CONNECTION , HttpHeaderValues . UPGRADE , true ) && headers . containsValue ( HttpHeaderNames . UPGRADE , HttpHeaderValues . WEBSOCKET , true ) ; }
Check the basic headers needed for WebSocket upgrade are contained in the request .