优化
This commit is contained in:
1 parent
b591fa22d2
commit
42a1b83bf3
1 file changed
+7
-5
@@ -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
|
||||
|
||||
Reference in new issue
Block a user