Stop overwriting request user-agent when bypassing Cloudflare (#8771)
* Bypass cloudflare WAF using webview * MyReadingManga: remove single cookie when bypassing Cloudflare * Don't overwrite request header when bypassing Cloudflare
This commit is contained in:
parent
fcc13cdfb0
commit
67bde7f28c
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'MyReadingManga'
|
extName = 'MyReadingManga'
|
||||||
pkgNameSuffix = 'all.myreadingmanga'
|
pkgNameSuffix = 'all.myreadingmanga'
|
||||||
extClass = '.MyReadingMangaFactory'
|
extClass = '.MyReadingMangaFactory'
|
||||||
extVersionCode = 42
|
extVersionCode = 43
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
containsNsfw = true
|
containsNsfw = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,10 +32,7 @@ class CloudflareWafInterceptor(private val cookieDomain: String) : Interceptor {
|
||||||
override fun intercept(chain: Interceptor.Chain): Response {
|
override fun intercept(chain: Interceptor.Chain): Response {
|
||||||
initWebView
|
initWebView
|
||||||
|
|
||||||
val originalRequest = chain.request()
|
val request = chain.request()
|
||||||
val request = originalRequest.newBuilder()
|
|
||||||
.header("User-Agent", initWebView)
|
|
||||||
.build()
|
|
||||||
val response = chain.proceed(request)
|
val response = chain.proceed(request)
|
||||||
|
|
||||||
if (response.code != 403 || response.header("Server") !in SERVER_CHECK) {
|
if (response.code != 403 || response.header("Server") !in SERVER_CHECK) {
|
||||||
|
|
Loading…
Reference in New Issue