Cubari: Fix brotli issue (#65)

This commit is contained in:
bapeey 2024-01-10 01:26:31 -05:00 committed by GitHub
parent f5395f23bb
commit 525daaa6d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Cubari'
pkgNameSuffix = "all.cubari"
extClass = '.CubariFactory'
extVersionCode = 23
extVersionCode = 24
}
apply from: "$rootDir/common.gradle"

View File

@ -38,6 +38,16 @@ open class Cubari(override val lang: String) : HttpSource() {
private val json: Json by injectLazy()
override val client = super.client.newBuilder()
.addInterceptor { chain ->
val request = chain.request()
val headers = request.headers.newBuilder()
.removeAll("Accept-Encoding")
.build()
chain.proceed(request.newBuilder().headers(headers).build())
}
.build()
override fun headersBuilder() = Headers.Builder().apply {
add(
"User-Agent",