From ed8bd0a8ef703f7e6dea647aa99ab13181f5ce9b Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Thu, 7 Aug 2025 21:56:31 +0200 Subject: [PATCH] fix: use the join function for merging davRootPath and path Using the join function ensures, that also paths without a leading slash a properly merged together. Extracted from 3978e056cf530a27503f81f8b8b3013c015b84bd. Signed-off-by: Daniel Kesselberg --- apps/files/src/services/Files.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/files/src/services/Files.ts b/apps/files/src/services/Files.ts index 94739f76006..aec09a728e9 100644 --- a/apps/files/src/services/Files.ts +++ b/apps/files/src/services/Files.ts @@ -7,6 +7,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav' import { CancelablePromise } from 'cancelable-promise' import { davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files' +import { join } from 'path' import { client } from './WebdavClient.ts' import logger from '../logger.ts' @@ -17,11 +18,10 @@ import logger from '../logger.ts' export const resultToNode = (node: FileStat): Node => davResultToNode(node) export const getContents = (path = '/'): CancelablePromise => { + path = join(davRootPath, path) const controller = new AbortController() const propfindPayload = davGetDefaultPropfind() - path = `${davRootPath}${path}` - return new CancelablePromise(async (resolve, reject, onCancel) => { onCancel(() => controller.abort()) try {