From 656f19036d83a71819cdcf472d8f5ab7c808b345 Mon Sep 17 00:00:00 2001 From: Richard North Date: Sat, 4 Aug 2018 16:10:07 +0100 Subject: [PATCH] Add decompression support to netty exec factory Fixes problem with gzip encoded streams (e.g. copy file from container) --- .../transport/TestcontainersDockerCmdExecFactory.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/testcontainers/dockerclient/transport/TestcontainersDockerCmdExecFactory.java b/core/src/main/java/org/testcontainers/dockerclient/transport/TestcontainersDockerCmdExecFactory.java index 976bb23c91d..179d24d37f6 100644 --- a/core/src/main/java/org/testcontainers/dockerclient/transport/TestcontainersDockerCmdExecFactory.java +++ b/core/src/main/java/org/testcontainers/dockerclient/transport/TestcontainersDockerCmdExecFactory.java @@ -19,6 +19,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.ssl.SslHandler; import io.netty.handler.timeout.IdleState; import io.netty.handler.timeout.IdleStateEvent; @@ -135,6 +136,7 @@ public EventLoopGroup epollGroup() { @Override protected void initChannel(final UnixChannel channel) throws Exception { channel.pipeline().addLast(new HttpClientCodec()); + channel.pipeline().addLast(new HttpContentDecompressor()); } }); return epollEventLoopGroup; @@ -148,6 +150,7 @@ public EventLoopGroup kqueueGroup() { @Override protected void initChannel(final KQueueDomainSocketChannel channel) throws Exception { channel.pipeline().addLast(new HttpClientCodec()); + channel.pipeline().addLast(new HttpContentDecompressor()); } }); @@ -175,6 +178,7 @@ public EventLoopGroup init(Bootstrap bootstrap, final DockerClientConfig dockerC @Override protected void initChannel(final SocketChannel channel) throws Exception { channel.pipeline().addLast(new HttpClientCodec()); + channel.pipeline().addLast(new HttpContentDecompressor()); } });