From ad9562192a97b8512d79c5f6c2803ed95f84274f Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 25 Feb 2022 15:26:01 +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 | 12 +++++++----- 1 file changed, 7 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 cc8897aec..5ad61c645 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 @@ -160,11 +160,13 @@ class WebDav(urlStr: String) { if (url != null && auth != null) { //防止报错 return kotlin.runCatching { - okHttpClient.newCallResponseBody { - url(url) - method("MKCOL", null) - addHeader("Authorization", Credentials.basic(auth.user, auth.pass)) - }.close() + if (!exists()) { + okHttpClient.newCallResponseBody { + url(url) + method("MKCOL", null) + addHeader("Authorization", Credentials.basic(auth.user, auth.pass)) + }.close() + } }.isSuccess } return false