mirror of
https://github.com/Athou/commafeed.git
synced 2026-10-17 09:50:37 +00:00
add support for brotli compression
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.commafeed.backend;
|
||||
|
||||
import com.aayushatharva.brotli4j.encoder.BrotliOutputStream;
|
||||
import com.codahale.metrics.MetricRegistry;
|
||||
import com.commafeed.CommaFeedConfiguration;
|
||||
import com.commafeed.CommaFeedVersion;
|
||||
@@ -418,7 +419,7 @@ class HttpGetterTest {
|
||||
@Nested
|
||||
class Compression {
|
||||
|
||||
private static final String ACCEPT_ENCODING = "deflate, gzip, zstd";
|
||||
private static final String ACCEPT_ENCODING = "deflate, gzip, zstd, br";
|
||||
|
||||
@Test
|
||||
void gzip() throws Exception {
|
||||
@@ -435,6 +436,11 @@ class HttpGetterTest {
|
||||
supportsCompression("zstd", ZstdOutputStream::new);
|
||||
}
|
||||
|
||||
@Test
|
||||
void br() throws Exception {
|
||||
supportsCompression("br", BrotliOutputStream::new);
|
||||
}
|
||||
|
||||
void supportsCompression(String encoding, CompressionFunction compressionFunction)
|
||||
throws Exception {
|
||||
String body = "my body";
|
||||
|
||||
Reference in New Issue
Block a user