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'
|
extName = 'VIZ'
|
||||||
pkgNameSuffix = 'en.vizshonenjump'
|
pkgNameSuffix = 'en.vizshonenjump'
|
||||||
extClass = '.VizFactory'
|
extClass = '.VizFactory'
|
||||||
extVersionCode = 19
|
extVersionCode = 20
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -40,6 +40,7 @@ open class Viz(
|
|||||||
override val supportsLatest = true
|
override val supportsLatest = true
|
||||||
|
|
||||||
override val client: OkHttpClient = network.client.newBuilder()
|
override val client: OkHttpClient = network.client.newBuilder()
|
||||||
|
.addInterceptor(::headersIntercept)
|
||||||
.addInterceptor(::authCheckIntercept)
|
.addInterceptor(::authCheckIntercept)
|
||||||
.addInterceptor(::authChapterCheckIntercept)
|
.addInterceptor(::authChapterCheckIntercept)
|
||||||
.addInterceptor(VizImageInterceptor())
|
.addInterceptor(VizImageInterceptor())
|
||||||
@ -293,6 +294,14 @@ open class Viz(
|
|||||||
loginCheckResponse.close()
|
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 {
|
private fun authCheckIntercept(chain: Interceptor.Chain): Response {
|
||||||
if (loggedIn == null) {
|
if (loggedIn == null) {
|
||||||
checkIfIsLoggedIn(chain)
|
checkIfIsLoggedIn(chain)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user