Buggy code:
public class HttpServer extends NetServerBase { private static final Logger log = Logger . getLogger ( HttpServer . class ) ; private Handler < HttpServerRequest > requestHandler ; private Handler < Websocket > wsHandler ; private Map < Channel , ServerConnection > connectionMap = new ConcurrentHashMap < > ( ) ; private ChannelGroup serverChannelGroup ; private boolean listening ; private WebSocketServerHandshaker webSocketHandShaker ; public HttpServer ( ) { } public HttpServer requestHandler ( Handler < HttpServerRequest > requestHandler ) { } public HttpServer websocketHandler ( Handler < Websocket > wsHandler ) { } public HttpServer listen ( int port ) { } public HttpServer listen ( int port , String host ) { } public HttpServer setSSL ( boolean ssl ) { } public HttpServer setKeyStorePath ( String path ) { } public HttpServer setKeyStorePassword ( String pwd ) { } public HttpServer setTrustStorePath ( String path ) { } public HttpServer setTrustStorePassword ( String pwd ) { } public HttpServer setClientAuthRequired ( boolean required ) { } public HttpServer setTcpNoDelay ( boolean tcpNoDelay ) { } public HttpServer setSendBufferSize ( int size ) { } public HttpServer setReceiveBufferSize ( int size ) { } public HttpServer setTCPKeepAlive ( boolean keepAlive ) { } public HttpServer setReuseAddress ( boolean reuse ) { } public HttpServer setSoLinger ( boolean linger ) { } public HttpServer setTrafficClass ( int trafficClass ) { } public void close ( ) { } public void close ( final Handler < Void > doneHandler ) { } public class ServerHandler extends SimpleChannelUpstreamHandler { @ Override public void messageReceived ( ChannelHandlerContext ctx , MessageEvent e ) throws Exception { NioSocketChannel ch = ( ( NioSocketChannel ) ( e . getChannel ( ) ) ) ; Object msg = e . getMessage ( ) ; ServerConnection conn = connectionMap . get ( ch ) ; if ( conn != null ) { if ( msg instanceof HttpRequest ) { final HttpRequest request = ( ( HttpRequest ) ( msg ) ) ; if ( HttpHeaders . is100ContinueExpected ( request ) ) { ch . write ( new org . jboss . netty . handler . codec . http . DefaultHttpResponse ( HTTP_1_1 , CONTINUE ) ) ; } <START_BUG> if ( ( request . getHeader ( CONNECTION ) . contains ( UPGRADE ) ) && ( WEBSOCKET . equalsIgnoreCase ( request . getHeader ( UPGRADE ) ) ) ) { <END_BUG> webSocketOpeningHandshake ( request , ctx , conn ) ; } else { conn . handleMessage ( msg ) ; } } else if ( msg instanceof WebSocketFrame ) { final WebSocketFrame frame = ( ( WebSocketFrame ) ( msg ) ) ; if ( frame instanceof CloseWebSocketFrame ) { webSocketClosingHandshake ( ctx , ( ( CloseWebSocketFrame ) ( frame ) ) ) ; } else if ( frame instanceof PingWebSocketFrame ) { ctx . getChannel ( ) . write ( new org . vertx . java . core . http . ws . PongWebSocketFrame ( frame . getBinaryData ( ) ) ) ; } else { conn . handleMessage ( msg ) ; } } else { conn . handleMessage ( msg ) ; } } } private void webSocketClosingHandshake ( final ChannelHandlerContext ctx , final CloseWebSocketFrame frame ) { } private void webSocketOpeningHandshake ( final HttpRequest request , final ChannelHandlerContext ctx , final ServerConnection conn ) { } @ Override public void exceptionCaught ( ChannelHandlerContext ctx , ExceptionEvent e ) throws Exception { } @ Override public void channelConnected ( ChannelHandlerContext ctx , ChannelStateEvent e ) { } @ Override public void channelClosed ( ChannelHandlerContext ctx , ChannelStateEvent e ) { } @ Override public void channelInterestChanged ( ChannelHandlerContext ctx , ChannelStateEvent e ) throws Exception { } private String getWebSocketLocation ( HttpRequest req , String path ) { } } public class Names { public static final String SEC_WEBSOCKET_VERSION = "Sec-WebSocket-Version" ; public static final String SEC_WEBSOCKET_KEY = "Sec-WebSocket-Key" ; public static final String SEC_WEBSOCKET_ACCEPT = "Sec-WebSocket-Accept" ; } }

Fix:
if ( ( ( request . containsHeader ( CONNECTION ) ) && ( request . getHeader ( CONNECTION ) . contains ( UPGRADE ) ) ) && ( WEBSOCKET . equalsIgnoreCase ( request . getHeader ( UPGRADE ) ) ) ) {