VIZ: Fix images could not be loaded (#19201)
Remove Accept-Encoding header
This commit is contained in:
parent
d14c9ba1ad
commit
1f0cf4f713
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'VIZ'
|
||||
pkgNameSuffix = 'en.vizshonenjump'
|
||||
extClass = '.VizFactory'
|
||||
extVersionCode = 19
|
||||
extVersionCode = 20
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -40,6 +40,7 @@ open class Viz(
|
|||
override val supportsLatest = true
|
||||
|
||||
override val client: OkHttpClient = network.client.newBuilder()
|
||||
.addInterceptor(::headersIntercept)
|
||||
.addInterceptor(::authCheckIntercept)
|
||||
.addInterceptor(::authChapterCheckIntercept)
|
||||
.addInterceptor(VizImageInterceptor())
|
||||
|
@ -293,6 +294,14 @@ open class Viz(
|
|||
loginCheckResponse.close()
|
||||
}
|
||||
|
||||
private fun headersIntercept(chain: Interceptor.Chain): Response {
|
||||
val request = chain.request()
|
||||
val headers = request.headers.newBuilder()
|
||||
.removeAll("Accept-Encoding")
|
||||
.build()
|
||||
return chain.proceed(request.newBuilder().headers(headers).build())
|
||||
}
|
||||
|
||||
private fun authCheckIntercept(chain: Interceptor.Chain): Response {
|
||||
if (loggedIn == null) {
|
||||
checkIfIsLoggedIn(chain)
|
||||
|
|
Loading…
Reference in New Issue