Fix mangaworld (#8501)

* dont intercept request coming from the cdn eg. skip images

* Update build.gradle

* fix comment

* remove comment

* idk

* revert version

* Update build.gradle.kts

* fix without cdn

* check content type
This commit is contained in:
mr-brune 2025-04-19 07:29:35 +02:00 committed by Draff
parent f7e3684d45
commit e6866d43c2
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 7 additions and 1 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc") id("lib-multisrc")
} }
baseVersionCode = 3 baseVersionCode = 4

View File

@ -14,6 +14,12 @@ class CookieRedirectInterceptor(private val client: OkHttpClient) : Interceptor
override fun intercept(chain: Interceptor.Chain): Response { override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request() val request = chain.request()
val response = chain.proceed(request) val response = chain.proceed(request)
val contentType = response.header("content-type")
if (contentType != null && contentType.startsWith("image/", ignoreCase = true)) {
return response
}
// ignore requests that already have completed the JS challenge // ignore requests that already have completed the JS challenge
if (response.headers["vary"] != null) return response if (response.headers["vary"] != null) return response