http: haha content-encoding goes brrrr (enabled brotli compression)

main
Alibek Omarov 4 years ago
parent e64831027c
commit ff5ec41e76
  1. 1
      app/build.gradle
  2. 2
      app/src/main/java/com/keylesspalace/tusky/util/OkHttpUtils.java

@ -149,6 +149,7 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttpVersion"
implementation "com.squareup.okhttp3:okhttp-brotli:$okhttpVersion"
implementation "org.conscrypt:conscrypt-android:2.2.1"

@ -32,6 +32,7 @@ import okhttp3.Cache;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.brotli.BrotliInterceptor;
public class OkHttpUtils {
@ -54,6 +55,7 @@ public class OkHttpUtils {
OkHttpClient.Builder builder = new OkHttpClient.Builder()
.addInterceptor(getUserAgentInterceptor())
.addInterceptor(BrotliInterceptor.INSTANCE)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.cache(new Cache(context.getCacheDir(), cacheSize));

Loading…
Cancel
Save