The handshake handler should not handle the exception and simply close the socket. The exception should be propagated to the WebSocketServerProtocolHandler to send the appropriate response and then close the socket.
This commit is contained in:
parent
40e53b9b68
commit
ff14feeb54
@ -78,12 +78,6 @@ public class WebSocketServerProtocolHandshakeHandler extends ChannelInboundMessa
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
logger.error("Exception Caught", cause);
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
private static void sendHttpResponse(ChannelHandlerContext ctx, HttpRequest req, HttpResponse res) {
|
||||
ChannelFuture f = ctx.channel().write(res);
|
||||
if (!isKeepAlive(req) || res.getStatus().getCode() != 200) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user