pull/1649/head
kunfei 3 years ago
parent 9d85b6abb0
commit ad9562192a
  1. 2
      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 {
if (!exists()) {
okHttpClient.newCallResponseBody { okHttpClient.newCallResponseBody {
url(url) url(url)
method("MKCOL", null) method("MKCOL", null)
addHeader("Authorization", Credentials.basic(auth.user, auth.pass)) addHeader("Authorization", Credentials.basic(auth.user, auth.pass))
}.close() }.close()
}
}.isSuccess }.isSuccess
} }
return false return false

Loading…
Cancel
Save