mirror of
https://github.com/Athou/commafeed.git
synced 2026-10-17 17:53:29 +00:00
add support for zstd compression
This commit is contained in:
@@ -7,6 +7,7 @@ import com.commafeed.backend.HttpGetter.HttpResponseException;
|
||||
import com.commafeed.backend.HttpGetter.HttpResult;
|
||||
import com.commafeed.backend.HttpGetter.NotModifiedException;
|
||||
import com.commafeed.backend.HttpGetter.TooManyRequestsException;
|
||||
import com.github.luben.zstd.ZstdOutputStream;
|
||||
import com.google.common.net.HttpHeaders;
|
||||
|
||||
import io.quarkus.runtime.configuration.MemorySize;
|
||||
@@ -417,7 +418,7 @@ class HttpGetterTest {
|
||||
@Nested
|
||||
class Compression {
|
||||
|
||||
private static final String ACCEPT_ENCODING = "deflate, gzip";
|
||||
private static final String ACCEPT_ENCODING = "deflate, gzip, zstd";
|
||||
|
||||
@Test
|
||||
void gzip() throws Exception {
|
||||
@@ -429,6 +430,11 @@ class HttpGetterTest {
|
||||
supportsCompression("deflate", DeflaterOutputStream::new);
|
||||
}
|
||||
|
||||
@Test
|
||||
void zstd() throws Exception {
|
||||
supportsCompression("zstd", ZstdOutputStream::new);
|
||||
}
|
||||
|
||||
void supportsCompression(String encoding, CompressionFunction compressionFunction)
|
||||
throws Exception {
|
||||
String body = "my body";
|
||||
|
||||
Reference in New Issue
Block a user