Skip to content

Commit

Permalink
Using constants in Web3ResultHttpResponseHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlopez committed Dec 8, 2020
1 parent 00a1558 commit 38daf11
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion;
import static io.netty.handler.codec.http.HttpHeaders.Names.CONTENT_TYPE;
import static io.netty.handler.codec.http.HttpHeaders.Values.APPLICATION_JSON;

public class Web3ResultHttpResponseHandler extends SimpleChannelInboundHandler<Web3Result> {

Expand All @@ -35,7 +37,7 @@ protected void channelRead0(ChannelHandlerContext ctx, Web3Result msg) {
msg.getContent()
);

response.headers().add("Content-Type", "application/json");
response.headers().add(CONTENT_TYPE, APPLICATION_JSON);

ctx.write(response).addListener(ChannelFutureListener.CLOSE);
}
Expand Down

0 comments on commit 38daf11

Please # to comment.