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