pull/1649/head
kunfei 3 years ago
parent 9d85b6abb0
commit ad9562192a
  1. 12
      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

Loading…
Cancel
Save