From 39d02d870e80d49efcd8e0e990953322dce3f611 Mon Sep 17 00:00:00 2001 From: Richard North Date: Mon, 13 Aug 2018 00:55:27 +0100 Subject: [PATCH] Allow netty to handle compressed response bodies Fixes #1079 --- .../github/dockerjava/netty/NettyDockerCmdExecFactory.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/github/dockerjava/netty/NettyDockerCmdExecFactory.java b/src/main/java/com/github/dockerjava/netty/NettyDockerCmdExecFactory.java index 5e63921e1..dfc740e35 100644 --- a/src/main/java/com/github/dockerjava/netty/NettyDockerCmdExecFactory.java +++ b/src/main/java/com/github/dockerjava/netty/NettyDockerCmdExecFactory.java @@ -39,6 +39,7 @@ import io.netty.channel.unix.DomainSocketAddress; import io.netty.channel.unix.UnixChannel; import io.netty.handler.codec.http.HttpClientCodec; +import io.netty.handler.codec.http.HttpContentDecompressor; import io.netty.handler.logging.LoggingHandler; import io.netty.handler.ssl.SslHandler; import io.netty.handler.timeout.IdleState; @@ -158,6 +159,7 @@ public EpollDomainSocketChannel newChannel() { @Override protected void initChannel(final UnixChannel channel) throws Exception { channel.pipeline().addLast(new HttpClientCodec()); + channel.pipeline().addLast(new HttpContentDecompressor()); } }); return epollEventLoopGroup; @@ -172,6 +174,7 @@ public EventLoopGroup kqueueGroup() { protected void initChannel(final KQueueDomainSocketChannel channel) throws Exception { channel.pipeline().addLast(new LoggingHandler(getClass())); channel.pipeline().addLast(new HttpClientCodec()); + channel.pipeline().addLast(new HttpContentDecompressor()); } }); @@ -212,6 +215,7 @@ protected void initChannel(final SocketChannel channel) throws Exception { // channel.pipeline().addLast(new // HttpProxyHandler(proxyAddress)); channel.pipeline().addLast(new HttpClientCodec()); + channel.pipeline().addLast(new HttpContentDecompressor()); } });