From 6afd984236d5d9bbb42733f996690ca425b504c6 Mon Sep 17 00:00:00 2001 From: 821938089 <821938089@qq.com> Date: Tue, 2 Aug 2022 06:09:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt | 4 +++- app/src/main/java/io/legado/app/lib/webdav/WebDav.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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)