From 69121653be004c2e5aaf5233930853127a6958f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 13 Aug 2024 09:23:47 +0200 Subject: [PATCH] fix: Use relative paths to dav root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/services/WebdavClient.ts | 6 ++++-- src/views/Viewer.vue | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/services/WebdavClient.ts b/src/services/WebdavClient.ts index 44b2d77d9..f5a138ee2 100644 --- a/src/services/WebdavClient.ts +++ b/src/services/WebdavClient.ts @@ -20,6 +20,8 @@ * */ -import { davGetClient } from '@nextcloud/files' +import { davGetClient, davRootPath, davGetRemoteURL } from '@nextcloud/files' -export const client = davGetClient() +const davRemote = davGetRemoteURL() + +export const client = davGetClient(`${davRemote}${davRootPath}`) diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index c996a5c19..26e46d1f9 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -599,9 +599,6 @@ export default { * @param {string|null} overrideHandlerId the ID of the handler with which to view the files, if any */ async openFile(path, overrideHandlerId = null) { - if (!path.startsWith(davRootPath)) { - path = `${davRootPath}${path}` - } await this.beforeOpen() // cancel any previous request