diff --git a/src/main/java/com/google/devtools/build/lib/remote/http/HttpBlobStore.java b/src/main/java/com/google/devtools/build/lib/remote/http/HttpBlobStore.java index 3c1b16b4ad7f6d..3d3f8badebf4cf 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/http/HttpBlobStore.java +++ b/src/main/java/com/google/devtools/build/lib/remote/http/HttpBlobStore.java @@ -43,6 +43,7 @@ import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.channel.unix.DomainSocketAddress; import io.netty.handler.codec.http.HttpClientCodec; +import io.netty.handler.codec.http.HttpContentDecompressor; import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpObjectAggregator; import io.netty.handler.codec.http.HttpRequestEncoder; @@ -367,6 +368,7 @@ private Future acquireDownloadChannel() { "timeout-handler", new IdleTimeoutHandler(timeoutSeconds, ReadTimeoutException.INSTANCE)); p.addLast(new HttpClientCodec()); + p.addLast("inflater", new HttpContentDecompressor()); synchronized (credentialsLock) { p.addLast(new HttpDownloadHandler(creds, extraHttpHeaders)); } @@ -397,6 +399,7 @@ private void releaseDownloadChannel(Channel ch) { try { ch.pipeline().remove(IdleTimeoutHandler.class); ch.pipeline().remove(HttpClientCodec.class); + ch.pipeline().remove(HttpContentDecompressor.class); ch.pipeline().remove(HttpDownloadHandler.class); } catch (NoSuchElementException e) { // If the channel is in the process of closing but not yet closed, some handlers could have diff --git a/src/main/java/com/google/devtools/build/lib/remote/http/HttpDownloadHandler.java b/src/main/java/com/google/devtools/build/lib/remote/http/HttpDownloadHandler.java index 335982013b0df2..f6016497b21009 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/http/HttpDownloadHandler.java +++ b/src/main/java/com/google/devtools/build/lib/remote/http/HttpDownloadHandler.java @@ -165,6 +165,7 @@ private HttpRequest buildRequest(String path, String host) { httpRequest.headers().set(HttpHeaderNames.HOST, host); httpRequest.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE); httpRequest.headers().set(HttpHeaderNames.ACCEPT, "*/*"); + httpRequest.headers().set(HttpHeaderNames.ACCEPT_ENCODING, HttpHeaderValues.GZIP); return httpRequest; }