Skip to content

Commit ce70de9

Browse files
committed
Add decompression support to netty exec factory
Fixes problem with gzip encoded streams (e.g. copy file from container)
1 parent 8907226 commit ce70de9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/main/java/org/testcontainers/dockerclient/transport/TestcontainersDockerCmdExecFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import io.netty.channel.unix.DomainSocketAddress;
2020
import io.netty.channel.unix.UnixChannel;
2121
import io.netty.handler.codec.http.HttpClientCodec;
22+
import io.netty.handler.codec.http.HttpContentDecompressor;
2223
import io.netty.handler.ssl.SslHandler;
2324
import io.netty.handler.timeout.IdleState;
2425
import io.netty.handler.timeout.IdleStateEvent;
@@ -135,6 +136,7 @@ public EventLoopGroup epollGroup() {
135136
@Override
136137
protected void initChannel(final UnixChannel channel) throws Exception {
137138
channel.pipeline().addLast(new HttpClientCodec());
139+
channel.pipeline().addLast(new HttpContentDecompressor());
138140
}
139141
});
140142
return epollEventLoopGroup;
@@ -148,6 +150,7 @@ public EventLoopGroup kqueueGroup() {
148150
@Override
149151
protected void initChannel(final KQueueDomainSocketChannel channel) throws Exception {
150152
channel.pipeline().addLast(new HttpClientCodec());
153+
channel.pipeline().addLast(new HttpContentDecompressor());
151154
}
152155
});
153156

@@ -175,6 +178,7 @@ public EventLoopGroup init(Bootstrap bootstrap, final DockerClientConfig dockerC
175178
@Override
176179
protected void initChannel(final SocketChannel channel) throws Exception {
177180
channel.pipeline().addLast(new HttpClientCodec());
181+
channel.pipeline().addLast(new HttpContentDecompressor());
178182
}
179183
});
180184

0 commit comments

Comments
 (0)