From 6664dfb04809904f400b130bd365a0f1ecce5f62 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 29 Nov 2020 16:01:16 -0500 Subject: [PATCH] Use regular minified extensions JSON instead of explicitly handling gzip encoding Turns out GitHub *does* do gzip encoding by default, it just doesn't show up in the header logs for some reason... --- .../extension/api/ExtensionGithubService.kt | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubService.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubService.kt index c8848b08c8..ecc5940aed 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubService.kt @@ -15,30 +15,18 @@ import uy.kohesive.injekt.injectLazy interface ExtensionGithubService { companion object { - private val client by lazy { - val network: NetworkHelper by injectLazy() - network.client.newBuilder() - .addNetworkInterceptor { chain -> - val originalResponse = chain.proceed(chain.request()) - originalResponse.newBuilder() - .header("Content-Encoding", "gzip") - .header("Content-Type", "application/json") - .build() - } - .build() - } - fun create(): ExtensionGithubService { + val network: NetworkHelper by injectLazy() val adapter = Retrofit.Builder() .baseUrl(ExtensionGithubApi.BASE_URL) .addConverterFactory(Json.asConverterFactory("application/json".toMediaType())) - .client(client) + .client(network.client) .build() return adapter.create(ExtensionGithubService::class.java) } } - @GET("${ExtensionGithubApi.REPO_URL_PREFIX}index.json.gz") + @GET("${ExtensionGithubApi.REPO_URL_PREFIX}index.min.json") suspend fun getRepo(): JsonArray }