From 17a8b4f1ff6706e61557e09d06db0ba6f6cce3d2 Mon Sep 17 00:00:00 2001 From: 821938089 <821938089@qq.com> Date: Tue, 5 Jul 2022 11:10:08 +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/lib/webdav/WebDav.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 4aa47edeb..207a707c4 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 @@ -172,14 +172,11 @@ open class WebDav(val path: String, val authorization: Authorization) { */ suspend fun exists(): Boolean { return kotlin.runCatching { - val requestPropsStr = DIR.replace("%s", "") return okHttpClient.newCallResponse { url(url) addHeader(authorization.name, authorization.data) - addHeader("Depth", "0") - val requestBody = requestPropsStr.toRequestBody("application/xml".toMediaType()) - method("PROPFIND", requestBody) - }.code == 207 + head() + }.code == 200 }.getOrDefault(false) }