Don't intercept on Varnish errors

This commit is contained in:
FooIbar authored and tarsin committed 2023-07-12 18:33:01 +08:00
1 parent 39b7623688
commit 8306640ed6
1 file changed
+2 -1
@@ -21,7 +21,8 @@ class CloudflareInterceptor(context: Context) : WebViewInterceptor(context) {
override fun shouldIntercept(response: Response): Boolean {
// Check if Cloudflare anti-bot is on
return response.code in ERROR_CODES && response.header("Server") in SERVER_CHECK
return response.code in ERROR_CODES && response.header("Server") in SERVER_CHECK &&
response.header("X-Varnish") == null
}
override fun intercept(