change the protocol decoder to check for a FullHttpRequest instead of a DefaultFullHttpRequest.
This change is needed after upgrading netty which now has slightly different semantics around http.
This commit is contained in:
parent
a58ccde8ee
commit
eb54800f57
|
@ -29,8 +29,8 @@ import io.netty.channel.ChannelHandler;
|
|||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.handler.codec.ByteToMessageDecoder;
|
||||
import io.netty.handler.codec.http.DefaultFullHttpRequest;
|
||||
import io.netty.handler.codec.http.DefaultFullHttpResponse;
|
||||
import io.netty.handler.codec.http.FullHttpRequest;
|
||||
import io.netty.handler.codec.http.HttpHeaders;
|
||||
import io.netty.handler.codec.http.HttpObjectAggregator;
|
||||
import io.netty.handler.codec.http.HttpRequestDecoder;
|
||||
|
@ -102,9 +102,9 @@ public class ProtocolHandler
|
|||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
|
||||
{
|
||||
if (msg instanceof DefaultFullHttpRequest)
|
||||
if (msg instanceof FullHttpRequest)
|
||||
{
|
||||
DefaultFullHttpRequest request = (DefaultFullHttpRequest) msg;
|
||||
FullHttpRequest request = (FullHttpRequest) msg;
|
||||
HttpHeaders headers = request.headers();
|
||||
String upgrade = headers.get("upgrade");
|
||||
if (upgrade != null && upgrade.equalsIgnoreCase("websocket"))
|
||||
|
|
Loading…
Reference in New Issue