Ensure the HttpResponseEncoder is always placed before the HttpObjectAggregator. Part of [#2219]

This commit is contained in:
Norman Maurer 2014-03-05 06:56:21 +01:00
parent 37ee6ef79a
commit 7c4ad004f6
5 changed files with 5 additions and 7 deletions

View File

@ -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());

View File

@ -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.

View File

@ -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());
}

View File

@ -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());
}
}

View File

@ -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());
}
}