From 38d04c927f8277389c42ad433c7fd5887d31913f Mon Sep 17 00:00:00 2001 From: jwilson Date: Sat, 1 Feb 2014 12:32:21 -0500 Subject: [PATCH] Tweak snoop example to send a full HTTP request. Without this, future HTTP requests on this channel will silently fail because the HttpObjectEncoder will be left in an unhappy state. --- .../java/io/netty/example/http/snoop/HttpSnoopClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/src/main/java/io/netty/example/http/snoop/HttpSnoopClient.java b/example/src/main/java/io/netty/example/http/snoop/HttpSnoopClient.java index 1c01c4cd57..4f52b2beef 100644 --- a/example/src/main/java/io/netty/example/http/snoop/HttpSnoopClient.java +++ b/example/src/main/java/io/netty/example/http/snoop/HttpSnoopClient.java @@ -22,7 +22,7 @@ import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.http.ClientCookieEncoder; import io.netty.handler.codec.http.DefaultCookie; -import io.netty.handler.codec.http.DefaultHttpRequest; +import io.netty.handler.codec.http.DefaultFullHttpRequest; import io.netty.handler.codec.http.HttpHeaders; import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpRequest; @@ -73,7 +73,7 @@ public class HttpSnoopClient { Channel ch = b.connect(host, port).sync().channel(); // Prepare the HTTP request. - HttpRequest request = new DefaultHttpRequest( + HttpRequest request = new DefaultFullHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.GET, uri.getRawPath()); request.headers().set(HttpHeaders.Names.HOST, host); request.headers().set(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE);