From 7c4ad004f6e1386012c93663767de62489562ee6 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Wed, 5 Mar 2014 06:56:21 +0100 Subject: [PATCH] Ensure the HttpResponseEncoder is always placed before the HttpObjectAggregator. Part of [#2219] --- .../java/io/netty/example/http/cors/HttpServerInitializer.java | 3 +-- .../example/http/file/HttpStaticFileServerInitializer.java | 2 +- .../netty/example/http/websocketx/html5/WebSocketServer.java | 2 +- .../websocketx/sslserver/WebSocketSslServerInitializer.java | 3 +-- .../websockets/autobahn/AutobahnServerInitializer.java | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/example/src/main/java/io/netty/example/http/cors/HttpServerInitializer.java b/example/src/main/java/io/netty/example/http/cors/HttpServerInitializer.java index ec4778f4fa..2297299b1d 100644 --- a/example/src/main/java/io/netty/example/http/cors/HttpServerInitializer.java +++ b/example/src/main/java/io/netty/example/http/cors/HttpServerInitializer.java @@ -75,10 +75,9 @@ public class HttpServerInitializer extends ChannelInitializer { 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()); diff --git a/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerInitializer.java b/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerInitializer.java index 5edb82af5d..9076f1d338 100644 --- a/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerInitializer.java +++ b/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerInitializer.java @@ -34,9 +34,9 @@ public class HttpStaticFileServerInitializer extends ChannelInitializer @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()); } }