From e2e6f6a12c45ca12cb1f450f3c85ba31cfcec7c9 Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:26:09 +0800 Subject: [PATCH] a little help for webdav addr --- src/remoteForWebdav.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/remoteForWebdav.ts b/src/remoteForWebdav.ts index 341b911..5a53fb8 100644 --- a/src/remoteForWebdav.ts +++ b/src/remoteForWebdav.ts @@ -527,6 +527,19 @@ export const checkConnectivity = async ( client: WrappedWebdavClient, callbackFunc?: any ) => { + if ( + !( + client.webdavConfig.address.startsWith("http://") || + client.webdavConfig.address.startsWith("https://") + ) + ) { + const err = "Error: the url should start with http(s):// but it does not!"; + log.debug(err); + if (callbackFunc !== undefined) { + callbackFunc(err); + } + return false; + } try { await client.init(); const results = await getRemoteMeta(client, "/");