forked from Archives/Athou_commafeed
use a brotli decoder that uses java and not native code
This commit is contained in:
@@ -521,6 +521,11 @@
|
||||
<artifactId>ayza-for-apache5</artifactId>
|
||||
<version>10.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.brotli</groupId>
|
||||
<artifactId>dec</artifactId>
|
||||
<version>0.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
|
||||
@@ -46,6 +46,7 @@ import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
|
||||
import org.apache.hc.core5.http.message.BasicHeader;
|
||||
import org.apache.hc.core5.util.TimeValue;
|
||||
import org.apache.hc.core5.util.Timeout;
|
||||
import org.brotli.dec.BrotliInputStream;
|
||||
import org.jboss.resteasy.reactive.common.headers.CacheControlDelegate;
|
||||
|
||||
import com.codahale.metrics.MetricRegistry;
|
||||
@@ -295,6 +296,7 @@ public class HttpGetter {
|
||||
Map<String, InputStreamFactory> contentDecoderMap = new LinkedHashMap<>();
|
||||
contentDecoderMap.put("gzip", GZIPInputStream::new);
|
||||
contentDecoderMap.put("deflate", DeflateInputStream::new);
|
||||
contentDecoderMap.put("br", BrotliInputStream::new);
|
||||
|
||||
return HttpClientBuilder.create()
|
||||
.useSystemProperties()
|
||||
|
||||
@@ -307,7 +307,7 @@ class HttpGetterTest {
|
||||
@Nested
|
||||
class Compression {
|
||||
|
||||
private static final String ACCEPT_ENCODING = "gzip, deflate";
|
||||
private static final String ACCEPT_ENCODING = "gzip, deflate, br";
|
||||
|
||||
@Test
|
||||
void gzip() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user