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) { if (url != null && auth != null) {
//防止报错 //防止报错
return kotlin.runCatching { return kotlin.runCatching {
okHttpClient.newCallResponseBody { if (!exists()) {
url(url) okHttpClient.newCallResponseBody {
method("MKCOL", null) url(url)
addHeader("Authorization", Credentials.basic(auth.user, auth.pass)) method("MKCOL", null)
}.close() addHeader("Authorization", Credentials.basic(auth.user, auth.pass))
}.close()
}
}.isSuccess }.isSuccess
} }
return false return false

Loading…
Cancel
Save