Ensure the HttpResponseEncoder is always placed before the HttpObjectAggregator. Part of [#2219]
This commit is contained in:
parent
1fe0b53e29
commit
6de58f5ad1
@ -75,10 +75,9 @@ public class HttpServerInitializer extends ChannelInitializer<SocketChannel> {
|
||||
ChannelPipeline pipeline = ch.pipeline();
|
||||
|
||||
CorsConfig corsConfig = CorsConfig.anyOrigin().build();
|
||||
|
||||
pipeline.addLast("encoder", new HttpResponseEncoder());
|
||||
pipeline.addLast("decoder", new HttpRequestDecoder());
|
||||
pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
|
||||
pipeline.addLast("encoder", new HttpResponseEncoder());
|
||||
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
|
||||
pipeline.addLast("cors", new CorsHandler(corsConfig));
|
||||
pipeline.addLast("handler", new OkResponseHandler());
|
||||
|
@ -34,9 +34,9 @@ public class HttpStaticFileServerInitializer extends ChannelInitializer<SocketCh
|
||||
//engine.setUseClientMode(false);
|
||||
//pipeline.addLast("ssl", new SslHandler(engine));
|
||||
|
||||
pipeline.addLast("encoder", new HttpResponseEncoder());
|
||||
pipeline.addLast("decoder", new HttpRequestDecoder());
|
||||
pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
|
||||
pipeline.addLast("encoder", new HttpResponseEncoder());
|
||||
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
|
||||
|
||||
pipeline.addLast("handler", new HttpStaticFileServerHandler(true)); // Specify false if SSL.
|
||||
|
@ -68,9 +68,9 @@ public class WebSocketServer {
|
||||
@Override
|
||||
public void initChannel(final SocketChannel ch) throws Exception {
|
||||
ch.pipeline().addLast(
|
||||
new HttpResponseEncoder(),
|
||||
new HttpRequestDecoder(),
|
||||
new HttpObjectAggregator(65536),
|
||||
new HttpResponseEncoder(),
|
||||
new WebSocketServerProtocolHandler("/websocket"),
|
||||
new CustomTextFrameHandler());
|
||||
}
|
||||
|
@ -35,10 +35,9 @@ public class WebSocketSslServerInitializer extends ChannelInitializer<SocketChan
|
||||
SSLEngine engine = WebSocketSslServerSslContext.getInstance().serverContext().createSSLEngine();
|
||||
engine.setUseClientMode(false);
|
||||
pipeline.addLast("ssl", new SslHandler(engine));
|
||||
|
||||
pipeline.addLast("encoder", new HttpResponseEncoder());
|
||||
pipeline.addLast("decoder", new HttpRequestDecoder());
|
||||
pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
|
||||
pipeline.addLast("encoder", new HttpResponseEncoder());
|
||||
pipeline.addLast("handler", new WebSocketSslServerHandler());
|
||||
}
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ public class AutobahnServerInitializer extends ChannelInitializer<SocketChannel>
|
||||
@Override
|
||||
public void initChannel(SocketChannel ch) throws Exception {
|
||||
ChannelPipeline pipeline = ch.pipeline();
|
||||
pipeline.addLast("encoder", new HttpResponseEncoder());
|
||||
pipeline.addLast("decoder", new HttpRequestDecoder());
|
||||
pipeline.addLast("aggregator", new HttpObjectAggregator(65536));
|
||||
pipeline.addLast("encoder", new HttpResponseEncoder());
|
||||
pipeline.addLast("handler", new AutobahnServerHandler());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user