diff options
author | Allan Wang <me@allanwang.ca> | 2019-12-08 00:29:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-08 00:29:40 -0800 |
commit | 15494d3b42315fa6fa7ae5daeb5ddf1f964b3932 (patch) | |
tree | c53221689ddeef3619572276fa530e8368abbde0 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt | |
parent | f9129dd7b59b4b3119805a49c21315e1f5a5e336 (diff) | |
download | frost-15494d3b42315fa6fa7ae5daeb5ddf1f964b3932.tar.gz frost-15494d3b42315fa6fa7ae5daeb5ddf1f964b3932.tar.bz2 frost-15494d3b42315fa6fa7ae5daeb5ddf1f964b3932.zip |
Update versions (#1591)
* Update versions
* Update travis android sdk
* Fix api updates
* Update dex plugin version
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt index ab910ebc..c4c6b81f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostRequestInterceptor.kt @@ -22,6 +22,7 @@ import android.webkit.WebView import com.pitchedapps.frost.utils.FrostPglAdBlock import com.pitchedapps.frost.utils.L import okhttp3.HttpUrl +import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import java.io.ByteArrayInputStream /** @@ -40,8 +41,8 @@ private val blankResource: WebResourceResponse by lazy { fun WebView.shouldFrostInterceptRequest(request: WebResourceRequest): WebResourceResponse? { val requestUrl = request.url?.toString() ?: return null - val httpUrl = HttpUrl.parse(requestUrl) ?: return null - val host = httpUrl.host() + val httpUrl = requestUrl.toHttpUrlOrNull() ?: return null + val host = httpUrl.host val url = httpUrl.toString() if (host.contains("facebook") || host.contains("fbcdn")) return null if (FrostPglAdBlock.isAd(host)) return blankResource |