pull/2119/head
821938089 2 years ago
parent 23f19c0484
commit 6afd984236
  1. 2
      app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt
  2. 2
      app/src/main/java/io/legado/app/lib/webdav/WebDav.kt

@ -159,10 +159,12 @@ class Coroutine<T>(
error?.let { dispatchCallback(this, e, it) } error?.let { dispatchCallback(this, e, it) }
} }
} finally { } finally {
withContext(NonCancellable) {
finally?.let { dispatchVoidCallback(this, it) } finally?.let { dispatchVoidCallback(this, it) }
} }
} }
} }
}
private suspend inline fun dispatchVoidCallback(scope: CoroutineScope, callback: VoidCallback) { private suspend inline fun dispatchVoidCallback(scope: CoroutineScope, callback: VoidCallback) {
if (null == callback.context) { if (null == callback.context) {

@ -71,7 +71,7 @@ open class WebDav(val path: String, val authorization: Authorization) {
private val webDavClient by lazy { private val webDavClient by lazy {
val authInterceptor = Interceptor { chain -> val authInterceptor = Interceptor { chain ->
var request = chain.request() var request = chain.request()
if (request.url.host == host) { if (request.url.host.equals(host, true)) {
request = request request = request
.newBuilder() .newBuilder()
.header(authorization.name, authorization.data) .header(authorization.name, authorization.data)

Loading…
Cancel
Save