diff --git a/example/src/main/java/io/netty/example/http/cors/OkResponseHandler.java b/example/src/main/java/io/netty/example/http/cors/OkResponseHandler.java index 07286391f5..3b9e00d4f5 100644 --- a/example/src/main/java/io/netty/example/http/cors/OkResponseHandler.java +++ b/example/src/main/java/io/netty/example/http/cors/OkResponseHandler.java @@ -18,7 +18,8 @@ package io.netty.example.http.cors; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.http.DefaultHttpResponse; +import io.netty.handler.codec.http.DefaultFullHttpResponse; +import io.netty.handler.codec.http.FullHttpResponse; import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.handler.codec.http.HttpVersion; @@ -30,7 +31,7 @@ public class OkResponseHandler extends ChannelHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { - final DefaultHttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK); + final FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK); response.headers().set("custom-response-header", "Some value"); ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE); }