diff --git a/app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt b/app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt index 31a556e7d..ce2731f64 100644 --- a/app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt +++ b/app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt @@ -159,7 +159,9 @@ class Coroutine( error?.let { dispatchCallback(this, e, it) } } } finally { - finally?.let { dispatchVoidCallback(this, it) } + withContext(NonCancellable) { + finally?.let { dispatchVoidCallback(this, it) } + } } } } diff --git a/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt b/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt index baeedd16e..d26934b1f 100644 --- a/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt +++ b/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt @@ -71,7 +71,7 @@ open class WebDav(val path: String, val authorization: Authorization) { private val webDavClient by lazy { val authInterceptor = Interceptor { chain -> var request = chain.request() - if (request.url.host == host) { + if (request.url.host.equals(host, true)) { request = request .newBuilder() .header(authorization.name, authorization.data)